snk-cli 0.2.1__tar.gz → 0.3.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {snk_cli-0.2.1 → snk_cli-0.3.0}/.github/workflows/tests.yml +4 -1
- {snk_cli-0.2.1 → snk_cli-0.3.0}/PKG-INFO +1 -1
- {snk_cli-0.2.1 → snk_cli-0.3.0}/src/snk_cli/__about__.py +1 -1
- {snk_cli-0.2.1 → snk_cli-0.3.0}/src/snk_cli/dynamic_typer.py +2 -2
- {snk_cli-0.2.1 → snk_cli-0.3.0}/src/snk_cli/subcommands/env.py +2 -2
- {snk_cli-0.2.1 → snk_cli-0.3.0}/src/snk_cli/subcommands/script.py +1 -1
- snk_cli-0.2.1/tests/data/workflow/workflow/envs/python.yml → snk_cli-0.3.0/tests/data/workflow/workflow/envs/wget.yml +1 -1
- {snk_cli-0.2.1 → snk_cli-0.3.0}/tests/test_cli/test_subcommands.py +5 -5
- {snk_cli-0.2.1 → snk_cli-0.3.0}/tests/test_conda_env.py +1 -1
- {snk_cli-0.2.1 → snk_cli-0.3.0}/.github/workflows/publish.yml +0 -0
- {snk_cli-0.2.1 → snk_cli-0.3.0}/.gitignore +0 -0
- {snk_cli-0.2.1 → snk_cli-0.3.0}/LICENSE.txt +0 -0
- {snk_cli-0.2.1 → snk_cli-0.3.0}/README.md +0 -0
- {snk_cli-0.2.1 → snk_cli-0.3.0}/docs/index.md +0 -0
- {snk_cli-0.2.1 → snk_cli-0.3.0}/docs/reference/cli.md +0 -0
- {snk_cli-0.2.1 → snk_cli-0.3.0}/docs/reference/config.md +0 -0
- {snk_cli-0.2.1 → snk_cli-0.3.0}/docs/reference/dynamic_typer.md +0 -0
- {snk_cli-0.2.1 → snk_cli-0.3.0}/docs/reference/options.md +0 -0
- {snk_cli-0.2.1 → snk_cli-0.3.0}/docs/reference/subcommands.md +0 -0
- {snk_cli-0.2.1 → snk_cli-0.3.0}/docs/reference/testing.md +0 -0
- {snk_cli-0.2.1 → snk_cli-0.3.0}/docs/reference/utils.md +0 -0
- {snk_cli-0.2.1 → snk_cli-0.3.0}/docs/reference/validate.md +0 -0
- {snk_cli-0.2.1 → snk_cli-0.3.0}/docs/reference/workflow.md +0 -0
- {snk_cli-0.2.1 → snk_cli-0.3.0}/mkdocs.yml +0 -0
- {snk_cli-0.2.1 → snk_cli-0.3.0}/pyproject.toml +0 -0
- {snk_cli-0.2.1 → snk_cli-0.3.0}/src/snk_cli/__init__.py +0 -0
- {snk_cli-0.2.1 → snk_cli-0.3.0}/src/snk_cli/cli.py +0 -0
- {snk_cli-0.2.1 → snk_cli-0.3.0}/src/snk_cli/conda.py +0 -0
- {snk_cli-0.2.1 → snk_cli-0.3.0}/src/snk_cli/config/__init__.py +0 -0
- {snk_cli-0.2.1 → snk_cli-0.3.0}/src/snk_cli/config/config.py +0 -0
- {snk_cli-0.2.1 → snk_cli-0.3.0}/src/snk_cli/config/utils.py +0 -0
- {snk_cli-0.2.1 → snk_cli-0.3.0}/src/snk_cli/options/__init__.py +0 -0
- {snk_cli-0.2.1 → snk_cli-0.3.0}/src/snk_cli/options/option.py +0 -0
- {snk_cli-0.2.1 → snk_cli-0.3.0}/src/snk_cli/options/utils.py +0 -0
- {snk_cli-0.2.1 → snk_cli-0.3.0}/src/snk_cli/subcommands/__init__.py +0 -0
- {snk_cli-0.2.1 → snk_cli-0.3.0}/src/snk_cli/subcommands/config.py +0 -0
- {snk_cli-0.2.1 → snk_cli-0.3.0}/src/snk_cli/subcommands/profile.py +0 -0
- {snk_cli-0.2.1 → snk_cli-0.3.0}/src/snk_cli/subcommands/run.py +0 -0
- {snk_cli-0.2.1 → snk_cli-0.3.0}/src/snk_cli/testing.py +0 -0
- {snk_cli-0.2.1 → snk_cli-0.3.0}/src/snk_cli/utils.py +0 -0
- {snk_cli-0.2.1 → snk_cli-0.3.0}/src/snk_cli/validate.py +0 -0
- {snk_cli-0.2.1 → snk_cli-0.3.0}/src/snk_cli/workflow.py +0 -0
- {snk_cli-0.2.1 → snk_cli-0.3.0}/tests/__init__.py +0 -0
- {snk_cli-0.2.1 → snk_cli-0.3.0}/tests/conftest.py +0 -0
- {snk_cli-0.2.1 → snk_cli-0.3.0}/tests/data/artic_v4.1.bed +0 -0
- {snk_cli-0.2.1 → snk_cli-0.3.0}/tests/data/config.yaml +0 -0
- {snk_cli-0.2.1 → snk_cli-0.3.0}/tests/data/cov.fasta +0 -0
- {snk_cli-0.2.1 → snk_cli-0.3.0}/tests/data/print_config/Snakefile +0 -0
- {snk_cli-0.2.1 → snk_cli-0.3.0}/tests/data/print_config/cli.py +0 -0
- {snk_cli-0.2.1 → snk_cli-0.3.0}/tests/data/print_config/config.yaml +0 -0
- {snk_cli-0.2.1 → snk_cli-0.3.0}/tests/data/print_config/snk.yaml +0 -0
- {snk_cli-0.2.1 → snk_cli-0.3.0}/tests/data/workflow/cli.py +0 -0
- {snk_cli-0.2.1 → snk_cli-0.3.0}/tests/data/workflow/config.yaml +0 -0
- {snk_cli-0.2.1 → snk_cli-0.3.0}/tests/data/workflow/resources/data.txt +0 -0
- {snk_cli-0.2.1 → snk_cli-0.3.0}/tests/data/workflow/snk.yaml +0 -0
- {snk_cli-0.2.1 → snk_cli-0.3.0}/tests/data/workflow/things/__about__.py +0 -0
- {snk_cli-0.2.1 → snk_cli-0.3.0}/tests/data/workflow/workflow/Snakefile +0 -0
- {snk_cli-0.2.1 → snk_cli-0.3.0}/tests/data/workflow/workflow/profiles/base/config.yaml +0 -0
- {snk_cli-0.2.1 → snk_cli-0.3.0}/tests/data/workflow/workflow/profiles/slurm/config.yaml +0 -0
- {snk_cli-0.2.1 → snk_cli-0.3.0}/tests/data/workflow/workflow/scripts/hello.py +0 -0
- {snk_cli-0.2.1 → snk_cli-0.3.0}/tests/test_cli/__init__.py +0 -0
- {snk_cli-0.2.1 → snk_cli-0.3.0}/tests/test_cli/test_dynamic_options.py +0 -0
- {snk_cli-0.2.1 → snk_cli-0.3.0}/tests/test_cli/test_run.py +0 -0
- {snk_cli-0.2.1 → snk_cli-0.3.0}/tests/test_cli/test_snk_config.py +0 -0
- {snk_cli-0.2.1 → snk_cli-0.3.0}/tests/test_cli/test_validate.py +0 -0
- {snk_cli-0.2.1 → snk_cli-0.3.0}/tests/test_cli/test_workflow_cli.py +0 -0
- {snk_cli-0.2.1 → snk_cli-0.3.0}/tests/test_dynamic_typer.py +0 -0
- {snk_cli-0.2.1 → snk_cli-0.3.0}/tests/utils.py +0 -0
|
@@ -11,7 +11,7 @@ jobs:
|
|
|
11
11
|
test:
|
|
12
12
|
runs-on: ubuntu-latest
|
|
13
13
|
steps:
|
|
14
|
-
- uses: actions/checkout@
|
|
14
|
+
- uses: actions/checkout@v4
|
|
15
15
|
with:
|
|
16
16
|
fetch-depth: 0
|
|
17
17
|
- uses: "conda-incubator/setup-miniconda@v2"
|
|
@@ -22,6 +22,9 @@ jobs:
|
|
|
22
22
|
channels: conda-forge,bioconda,defaults
|
|
23
23
|
channel-priority: strict
|
|
24
24
|
auto-update-conda: true
|
|
25
|
+
- uses: actions/setup-python@v5
|
|
26
|
+
with:
|
|
27
|
+
python-version: '3.11'
|
|
25
28
|
- uses: actions/cache@v2
|
|
26
29
|
with:
|
|
27
30
|
key: ${{ github.ref }}
|
|
@@ -11,7 +11,7 @@ class DynamicTyper:
|
|
|
11
11
|
app: typer.Typer
|
|
12
12
|
|
|
13
13
|
def __init__(self):
|
|
14
|
-
self.app = typer.Typer()
|
|
14
|
+
self.app = typer.Typer(add_completion=False)
|
|
15
15
|
|
|
16
16
|
def __call__(self):
|
|
17
17
|
"""
|
|
@@ -33,7 +33,7 @@ class DynamicTyper:
|
|
|
33
33
|
Sets the app attribute to a Typer object.
|
|
34
34
|
"""
|
|
35
35
|
if not hasattr(self, "app"):
|
|
36
|
-
self.app = typer.Typer()
|
|
36
|
+
self.app = typer.Typer(add_completion=False)
|
|
37
37
|
|
|
38
38
|
def register_default_command(self, command: Callable, **command_kwargs) -> None:
|
|
39
39
|
"""
|
|
@@ -80,7 +80,7 @@ class EnvApp(DynamicTyper):
|
|
|
80
80
|
cmd = f"{self.workflow.name} env activate {env.stem}"
|
|
81
81
|
else:
|
|
82
82
|
address = ""
|
|
83
|
-
cmd = f"{self.workflow.name} env
|
|
83
|
+
cmd = f"{self.workflow.name} env create {env.stem}"
|
|
84
84
|
table.add_row(
|
|
85
85
|
env.stem, cmd, address
|
|
86
86
|
)
|
|
@@ -153,7 +153,7 @@ class EnvApp(DynamicTyper):
|
|
|
153
153
|
def create(
|
|
154
154
|
self,
|
|
155
155
|
names: Optional[List[str]] = typer.Argument(None, help="The names of the environments to create. If not provided, all environments will be created."),
|
|
156
|
-
max_workers: int = typer.Option(
|
|
156
|
+
max_workers: int = typer.Option(1, "--workers", "-w", help="Max number of envs to create in parallel.")
|
|
157
157
|
):
|
|
158
158
|
if names:
|
|
159
159
|
env_paths = [self._get_conda_env_path(name) for name in names]
|
|
@@ -50,7 +50,7 @@ class ScriptApp(DynamicTyper):
|
|
|
50
50
|
table = Table("Name", "CMD", "File", show_header=True, show_lines=True)
|
|
51
51
|
for script in self.workflow.scripts:
|
|
52
52
|
# address relative to cwd
|
|
53
|
-
table.add_row(script.stem, f"{self.workflow.name} script
|
|
53
|
+
table.add_row(script.stem, f"{self.workflow.name} script run {script.stem} --env ...", str(script.resolve()) if verbose else script.name)
|
|
54
54
|
console = Console()
|
|
55
55
|
console.print(table)
|
|
56
56
|
|
|
@@ -6,12 +6,12 @@ import pytest
|
|
|
6
6
|
(["script", "show", "hello.py"], ["print('hello world')"], []),
|
|
7
7
|
(["profile", "list"], ["slurm"], []),
|
|
8
8
|
(["profile", "show", "slurm"], ["cluster"], []),
|
|
9
|
-
(["env", "list"], ["
|
|
10
|
-
(["env", "show", "
|
|
9
|
+
(["env", "list"], ["wget"], []),
|
|
10
|
+
(["env", "show", "wget"], ["wget"], []),
|
|
11
11
|
(["env", "create"], ["All conda environments created!"], []),
|
|
12
|
-
(["env", "create", "
|
|
13
|
-
(["env", "run", "
|
|
14
|
-
(["env", "activate", "
|
|
12
|
+
(["env", "create", "wget"], ["Created environment wget!"], []),
|
|
13
|
+
(["env", "run", "wget", "which wget"], [".conda"], []),
|
|
14
|
+
(["env", "activate", "wget"], [], ["Activating wget environment...", "Exiting wget environment..."]),
|
|
15
15
|
(["env", "remove", "-f"], ["Deleted"], []),
|
|
16
16
|
(["info"], ["name", "version", "snakefile", "conda_prefix_dir", "singularity_prefix_dir", "workflow_dir_path"], []),
|
|
17
17
|
])
|
|
@@ -4,7 +4,7 @@ from pathlib import Path
|
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
def test_conda_env(tmp_path):
|
|
7
|
-
env = conda_environment_factory("tests/data/workflow/workflow/envs/
|
|
7
|
+
env = conda_environment_factory("tests/data/workflow/workflow/envs/wget.yml", tmp_path)
|
|
8
8
|
assert isinstance(env, Env)
|
|
9
9
|
assert not Path(env.address).exists()
|
|
10
10
|
env.create()
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|