Skip to content

Commit

Permalink
move cli to src/rail/cli/rail (#171)
Browse files Browse the repository at this point in the history
* move cli to src/rail/cli/rail

* fix import in tests

* fix one more import

* fix typo
  • Loading branch information
eacharles authored Dec 4, 2024
1 parent 454c32e commit 30c6425
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 6 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ dev = [
]

[project.scripts]
rail = "rail.cli.commands:cli"
rail = "rail.cli.rail.commands:cli"

[build-system]
requires = [
Expand Down
Empty file added src/rail/cli/rail/__init__.py
Empty file.
5 changes: 5 additions & 0 deletions src/rail/cli/rail/__main__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# This file must exist with these contents
from .commands import cli

if __name__ == "__main__":
cli()
2 changes: 1 addition & 1 deletion src/rail/cli/commands.py → src/rail/cli/rail/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import yaml

from rail.core import __version__
from rail.cli import options, scripts
from rail.cli.rail import options, scripts
from rail.interfaces.pz_factory import PZFactory
from rail.interfaces.tool_factory import ToolFactory
from rail.utils import catalog_utils
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion src/rail/cli/scripts.py → src/rail/cli/rail/scripts.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import rail.stages
from rail.core import RailEnv
from rail.core.stage import RailPipeline
from rail.cli.options import GitMode
from rail.cli.rail.options import GitMode
from rail.utils.path_utils import RAILDIR
from rail.utils import catalog_utils

Expand Down
2 changes: 1 addition & 1 deletion src/rail/utils/testing_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from rail.core.stage import RailStage
from rail.utils.path_utils import RAILDIR
from rail.core.data import TableHandle
from rail.cli.scripts import build_pipeline
from rail.cli.rail.scripts import build_pipeline

traindata = os.path.join(RAILDIR, "rail/examples_data/testdata/training_100gal.hdf5")
validdata = os.path.join(RAILDIR, "rail/examples_data/testdata/validation_10gal.hdf5")
Expand Down
4 changes: 2 additions & 2 deletions tests/cli/test_scripts.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import glob
import os
import pytest
from rail.cli import scripts
from rail.cli.options import args_to_dict, GitMode
from rail.cli.rail import scripts
from rail.cli.rail.options import args_to_dict, GitMode



Expand Down

0 comments on commit 30c6425

Please sign in to comment.