snk-cli 0.2.0__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.
Files changed (68) hide show
  1. {snk_cli-0.2.0 → snk_cli-0.3.0}/.github/workflows/tests.yml +4 -1
  2. {snk_cli-0.2.0 → snk_cli-0.3.0}/PKG-INFO +1 -1
  3. {snk_cli-0.2.0 → snk_cli-0.3.0}/pyproject.toml +1 -6
  4. {snk_cli-0.2.0 → snk_cli-0.3.0}/src/snk_cli/__about__.py +1 -1
  5. {snk_cli-0.2.0 → snk_cli-0.3.0}/src/snk_cli/dynamic_typer.py +2 -2
  6. {snk_cli-0.2.0 → snk_cli-0.3.0}/src/snk_cli/subcommands/env.py +2 -2
  7. {snk_cli-0.2.0 → snk_cli-0.3.0}/src/snk_cli/subcommands/run.py +1 -3
  8. {snk_cli-0.2.0 → snk_cli-0.3.0}/src/snk_cli/subcommands/script.py +1 -1
  9. snk_cli-0.2.0/tests/data/workflow/workflow/envs/python.yml → snk_cli-0.3.0/tests/data/workflow/workflow/envs/wget.yml +1 -1
  10. {snk_cli-0.2.0 → snk_cli-0.3.0}/tests/test_cli/test_run.py +9 -0
  11. {snk_cli-0.2.0 → snk_cli-0.3.0}/tests/test_cli/test_subcommands.py +5 -5
  12. {snk_cli-0.2.0 → snk_cli-0.3.0}/tests/test_conda_env.py +1 -1
  13. {snk_cli-0.2.0 → snk_cli-0.3.0}/.github/workflows/publish.yml +0 -0
  14. {snk_cli-0.2.0 → snk_cli-0.3.0}/.gitignore +0 -0
  15. {snk_cli-0.2.0 → snk_cli-0.3.0}/LICENSE.txt +0 -0
  16. {snk_cli-0.2.0 → snk_cli-0.3.0}/README.md +0 -0
  17. {snk_cli-0.2.0 → snk_cli-0.3.0}/docs/index.md +0 -0
  18. {snk_cli-0.2.0 → snk_cli-0.3.0}/docs/reference/cli.md +0 -0
  19. {snk_cli-0.2.0 → snk_cli-0.3.0}/docs/reference/config.md +0 -0
  20. {snk_cli-0.2.0 → snk_cli-0.3.0}/docs/reference/dynamic_typer.md +0 -0
  21. {snk_cli-0.2.0 → snk_cli-0.3.0}/docs/reference/options.md +0 -0
  22. {snk_cli-0.2.0 → snk_cli-0.3.0}/docs/reference/subcommands.md +0 -0
  23. {snk_cli-0.2.0 → snk_cli-0.3.0}/docs/reference/testing.md +0 -0
  24. {snk_cli-0.2.0 → snk_cli-0.3.0}/docs/reference/utils.md +0 -0
  25. {snk_cli-0.2.0 → snk_cli-0.3.0}/docs/reference/validate.md +0 -0
  26. {snk_cli-0.2.0 → snk_cli-0.3.0}/docs/reference/workflow.md +0 -0
  27. {snk_cli-0.2.0 → snk_cli-0.3.0}/mkdocs.yml +0 -0
  28. {snk_cli-0.2.0 → snk_cli-0.3.0}/src/snk_cli/__init__.py +0 -0
  29. {snk_cli-0.2.0 → snk_cli-0.3.0}/src/snk_cli/cli.py +0 -0
  30. {snk_cli-0.2.0 → snk_cli-0.3.0}/src/snk_cli/conda.py +0 -0
  31. {snk_cli-0.2.0 → snk_cli-0.3.0}/src/snk_cli/config/__init__.py +0 -0
  32. {snk_cli-0.2.0 → snk_cli-0.3.0}/src/snk_cli/config/config.py +0 -0
  33. {snk_cli-0.2.0 → snk_cli-0.3.0}/src/snk_cli/config/utils.py +0 -0
  34. {snk_cli-0.2.0 → snk_cli-0.3.0}/src/snk_cli/options/__init__.py +0 -0
  35. {snk_cli-0.2.0 → snk_cli-0.3.0}/src/snk_cli/options/option.py +0 -0
  36. {snk_cli-0.2.0 → snk_cli-0.3.0}/src/snk_cli/options/utils.py +0 -0
  37. {snk_cli-0.2.0 → snk_cli-0.3.0}/src/snk_cli/subcommands/__init__.py +0 -0
  38. {snk_cli-0.2.0 → snk_cli-0.3.0}/src/snk_cli/subcommands/config.py +0 -0
  39. {snk_cli-0.2.0 → snk_cli-0.3.0}/src/snk_cli/subcommands/profile.py +0 -0
  40. {snk_cli-0.2.0 → snk_cli-0.3.0}/src/snk_cli/testing.py +0 -0
  41. {snk_cli-0.2.0 → snk_cli-0.3.0}/src/snk_cli/utils.py +0 -0
  42. {snk_cli-0.2.0 → snk_cli-0.3.0}/src/snk_cli/validate.py +0 -0
  43. {snk_cli-0.2.0 → snk_cli-0.3.0}/src/snk_cli/workflow.py +0 -0
  44. {snk_cli-0.2.0 → snk_cli-0.3.0}/tests/__init__.py +0 -0
  45. {snk_cli-0.2.0 → snk_cli-0.3.0}/tests/conftest.py +0 -0
  46. {snk_cli-0.2.0 → snk_cli-0.3.0}/tests/data/artic_v4.1.bed +0 -0
  47. {snk_cli-0.2.0 → snk_cli-0.3.0}/tests/data/config.yaml +0 -0
  48. {snk_cli-0.2.0 → snk_cli-0.3.0}/tests/data/cov.fasta +0 -0
  49. {snk_cli-0.2.0 → snk_cli-0.3.0}/tests/data/print_config/Snakefile +0 -0
  50. {snk_cli-0.2.0 → snk_cli-0.3.0}/tests/data/print_config/cli.py +0 -0
  51. {snk_cli-0.2.0 → snk_cli-0.3.0}/tests/data/print_config/config.yaml +0 -0
  52. {snk_cli-0.2.0 → snk_cli-0.3.0}/tests/data/print_config/snk.yaml +0 -0
  53. {snk_cli-0.2.0 → snk_cli-0.3.0}/tests/data/workflow/cli.py +0 -0
  54. {snk_cli-0.2.0 → snk_cli-0.3.0}/tests/data/workflow/config.yaml +0 -0
  55. {snk_cli-0.2.0 → snk_cli-0.3.0}/tests/data/workflow/resources/data.txt +0 -0
  56. {snk_cli-0.2.0 → snk_cli-0.3.0}/tests/data/workflow/snk.yaml +0 -0
  57. {snk_cli-0.2.0 → snk_cli-0.3.0}/tests/data/workflow/things/__about__.py +0 -0
  58. {snk_cli-0.2.0 → snk_cli-0.3.0}/tests/data/workflow/workflow/Snakefile +0 -0
  59. {snk_cli-0.2.0 → snk_cli-0.3.0}/tests/data/workflow/workflow/profiles/base/config.yaml +0 -0
  60. {snk_cli-0.2.0 → snk_cli-0.3.0}/tests/data/workflow/workflow/profiles/slurm/config.yaml +0 -0
  61. {snk_cli-0.2.0 → snk_cli-0.3.0}/tests/data/workflow/workflow/scripts/hello.py +0 -0
  62. {snk_cli-0.2.0 → snk_cli-0.3.0}/tests/test_cli/__init__.py +0 -0
  63. {snk_cli-0.2.0 → snk_cli-0.3.0}/tests/test_cli/test_dynamic_options.py +0 -0
  64. {snk_cli-0.2.0 → snk_cli-0.3.0}/tests/test_cli/test_snk_config.py +0 -0
  65. {snk_cli-0.2.0 → snk_cli-0.3.0}/tests/test_cli/test_validate.py +0 -0
  66. {snk_cli-0.2.0 → snk_cli-0.3.0}/tests/test_cli/test_workflow_cli.py +0 -0
  67. {snk_cli-0.2.0 → snk_cli-0.3.0}/tests/test_dynamic_typer.py +0 -0
  68. {snk_cli-0.2.0 → 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@v3
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 }}
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: snk-cli
3
- Version: 0.2.0
3
+ Version: 0.3.0
4
4
  Project-URL: Documentation, https://github.com/unknown/snk-cli#readme
5
5
  Project-URL: Issues, https://github.com/unknown/snk-cli/issues
6
6
  Project-URL: Source, https://github.com/unknown/snk-cli
@@ -46,16 +46,11 @@ path = "src/snk_cli/__about__.py"
46
46
  [[tool.hatch.envs.snakemake.matrix]]
47
47
  snakemake = ["7.32.4", "8.10.8"]
48
48
 
49
- [tool.hatch.snakemake.test]
50
- dependencies = [
51
- "coverage[toml]>=6.5",
52
- "pytest",
53
- "snakemake=={matrix:snakemake}"]
54
-
55
49
  [tool.hatch.envs.default]
56
50
  dependencies = [
57
51
  "coverage[toml]>=6.5",
58
52
  "pytest",
53
+ "snakemake=={matrix:snakemake:7.32.4}",
59
54
  ]
60
55
  [tool.hatch.envs.default.scripts]
61
56
  test = "pytest {args:tests}"
@@ -1,4 +1,4 @@
1
1
  # SPDX-FileCopyrightText: 2024-present Wytamma Wirth <wytamma.wirth@me.com>
2
2
  #
3
3
  # SPDX-License-Identifier: MIT
4
- __version__ = "0.2.0"
4
+ __version__ = "0.3.0"
@@ -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 show {env.stem}"
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(get_num_cores(), "--workers", "-w", help="Max number of envs to create in parallel.")
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]
@@ -65,9 +65,7 @@ class RunApp(DynamicTyper):
65
65
  >>> RunApp._print_snakemake_help(True)
66
66
  """
67
67
  if value:
68
- import snakemake
69
-
70
- snakemake.main("-h")
68
+ execute_snakemake("-h")
71
69
 
72
70
  def run(
73
71
  self,
@@ -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 show {script.stem}", str(script.resolve()) if verbose else script.name)
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
 
@@ -2,4 +2,4 @@ channels:
2
2
  - bioconda
3
3
  - conda-forge
4
4
  dependencies:
5
- - python=3.9
5
+ - wget
@@ -39,3 +39,12 @@ def test_run_with_config(tmp_path):
39
39
  assert res.exit_code == 0, res.stderr
40
40
  assert "cli" in res.stdout, res.stderr
41
41
 
42
+ def test_snakemake_help(local_runner: SnkCliRunner):
43
+ res = local_runner(["run", "-hs"])
44
+ assert res.exit_code == 0, res.stderr
45
+ assert "snakemake" in res.stdout
46
+
47
+ def test_snakemake_version(local_runner: SnkCliRunner):
48
+ res = local_runner(["run", "--snake-v"])
49
+ assert res.exit_code == 0, res.stderr
50
+ assert res.stdout in ["7.32.4\n", "8.10.8\n"]
@@ -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"], ["python"], []),
10
- (["env", "show", "python"], ["python"], []),
9
+ (["env", "list"], ["wget"], []),
10
+ (["env", "show", "wget"], ["wget"], []),
11
11
  (["env", "create"], ["All conda environments created!"], []),
12
- (["env", "create", "python"], ["Created environment python!"], []),
13
- (["env", "run", "python", "which python"], ["bin/python"], []),
14
- (["env", "activate", "python"], [], ["Activating python environment...", "Exiting python environment..."]),
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/python.yml", tmp_path)
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