snk-cli 0.2.1__tar.gz → 0.3.1__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.1 → snk_cli-0.3.1}/.github/workflows/tests.yml +4 -1
  2. {snk_cli-0.2.1 → snk_cli-0.3.1}/PKG-INFO +2 -2
  3. {snk_cli-0.2.1 → snk_cli-0.3.1}/pyproject.toml +1 -1
  4. {snk_cli-0.2.1 → snk_cli-0.3.1}/src/snk_cli/__about__.py +1 -1
  5. {snk_cli-0.2.1 → snk_cli-0.3.1}/src/snk_cli/dynamic_typer.py +2 -2
  6. {snk_cli-0.2.1 → snk_cli-0.3.1}/src/snk_cli/subcommands/env.py +2 -2
  7. {snk_cli-0.2.1 → snk_cli-0.3.1}/src/snk_cli/subcommands/script.py +4 -2
  8. snk_cli-0.2.1/tests/data/workflow/workflow/envs/python.yml → snk_cli-0.3.1/tests/data/workflow/workflow/envs/wget.yml +1 -1
  9. {snk_cli-0.2.1 → snk_cli-0.3.1}/tests/test_cli/test_subcommands.py +5 -5
  10. {snk_cli-0.2.1 → snk_cli-0.3.1}/tests/test_conda_env.py +1 -1
  11. {snk_cli-0.2.1 → snk_cli-0.3.1}/.github/workflows/publish.yml +0 -0
  12. {snk_cli-0.2.1 → snk_cli-0.3.1}/.gitignore +0 -0
  13. {snk_cli-0.2.1 → snk_cli-0.3.1}/LICENSE.txt +0 -0
  14. {snk_cli-0.2.1 → snk_cli-0.3.1}/README.md +0 -0
  15. {snk_cli-0.2.1 → snk_cli-0.3.1}/docs/index.md +0 -0
  16. {snk_cli-0.2.1 → snk_cli-0.3.1}/docs/reference/cli.md +0 -0
  17. {snk_cli-0.2.1 → snk_cli-0.3.1}/docs/reference/config.md +0 -0
  18. {snk_cli-0.2.1 → snk_cli-0.3.1}/docs/reference/dynamic_typer.md +0 -0
  19. {snk_cli-0.2.1 → snk_cli-0.3.1}/docs/reference/options.md +0 -0
  20. {snk_cli-0.2.1 → snk_cli-0.3.1}/docs/reference/subcommands.md +0 -0
  21. {snk_cli-0.2.1 → snk_cli-0.3.1}/docs/reference/testing.md +0 -0
  22. {snk_cli-0.2.1 → snk_cli-0.3.1}/docs/reference/utils.md +0 -0
  23. {snk_cli-0.2.1 → snk_cli-0.3.1}/docs/reference/validate.md +0 -0
  24. {snk_cli-0.2.1 → snk_cli-0.3.1}/docs/reference/workflow.md +0 -0
  25. {snk_cli-0.2.1 → snk_cli-0.3.1}/mkdocs.yml +0 -0
  26. {snk_cli-0.2.1 → snk_cli-0.3.1}/src/snk_cli/__init__.py +0 -0
  27. {snk_cli-0.2.1 → snk_cli-0.3.1}/src/snk_cli/cli.py +0 -0
  28. {snk_cli-0.2.1 → snk_cli-0.3.1}/src/snk_cli/conda.py +0 -0
  29. {snk_cli-0.2.1 → snk_cli-0.3.1}/src/snk_cli/config/__init__.py +0 -0
  30. {snk_cli-0.2.1 → snk_cli-0.3.1}/src/snk_cli/config/config.py +0 -0
  31. {snk_cli-0.2.1 → snk_cli-0.3.1}/src/snk_cli/config/utils.py +0 -0
  32. {snk_cli-0.2.1 → snk_cli-0.3.1}/src/snk_cli/options/__init__.py +0 -0
  33. {snk_cli-0.2.1 → snk_cli-0.3.1}/src/snk_cli/options/option.py +0 -0
  34. {snk_cli-0.2.1 → snk_cli-0.3.1}/src/snk_cli/options/utils.py +0 -0
  35. {snk_cli-0.2.1 → snk_cli-0.3.1}/src/snk_cli/subcommands/__init__.py +0 -0
  36. {snk_cli-0.2.1 → snk_cli-0.3.1}/src/snk_cli/subcommands/config.py +0 -0
  37. {snk_cli-0.2.1 → snk_cli-0.3.1}/src/snk_cli/subcommands/profile.py +0 -0
  38. {snk_cli-0.2.1 → snk_cli-0.3.1}/src/snk_cli/subcommands/run.py +0 -0
  39. {snk_cli-0.2.1 → snk_cli-0.3.1}/src/snk_cli/testing.py +0 -0
  40. {snk_cli-0.2.1 → snk_cli-0.3.1}/src/snk_cli/utils.py +0 -0
  41. {snk_cli-0.2.1 → snk_cli-0.3.1}/src/snk_cli/validate.py +0 -0
  42. {snk_cli-0.2.1 → snk_cli-0.3.1}/src/snk_cli/workflow.py +0 -0
  43. {snk_cli-0.2.1 → snk_cli-0.3.1}/tests/__init__.py +0 -0
  44. {snk_cli-0.2.1 → snk_cli-0.3.1}/tests/conftest.py +0 -0
  45. {snk_cli-0.2.1 → snk_cli-0.3.1}/tests/data/artic_v4.1.bed +0 -0
  46. {snk_cli-0.2.1 → snk_cli-0.3.1}/tests/data/config.yaml +0 -0
  47. {snk_cli-0.2.1 → snk_cli-0.3.1}/tests/data/cov.fasta +0 -0
  48. {snk_cli-0.2.1 → snk_cli-0.3.1}/tests/data/print_config/Snakefile +0 -0
  49. {snk_cli-0.2.1 → snk_cli-0.3.1}/tests/data/print_config/cli.py +0 -0
  50. {snk_cli-0.2.1 → snk_cli-0.3.1}/tests/data/print_config/config.yaml +0 -0
  51. {snk_cli-0.2.1 → snk_cli-0.3.1}/tests/data/print_config/snk.yaml +0 -0
  52. {snk_cli-0.2.1 → snk_cli-0.3.1}/tests/data/workflow/cli.py +0 -0
  53. {snk_cli-0.2.1 → snk_cli-0.3.1}/tests/data/workflow/config.yaml +0 -0
  54. {snk_cli-0.2.1 → snk_cli-0.3.1}/tests/data/workflow/resources/data.txt +0 -0
  55. {snk_cli-0.2.1 → snk_cli-0.3.1}/tests/data/workflow/snk.yaml +0 -0
  56. {snk_cli-0.2.1 → snk_cli-0.3.1}/tests/data/workflow/things/__about__.py +0 -0
  57. {snk_cli-0.2.1 → snk_cli-0.3.1}/tests/data/workflow/workflow/Snakefile +0 -0
  58. {snk_cli-0.2.1 → snk_cli-0.3.1}/tests/data/workflow/workflow/profiles/base/config.yaml +0 -0
  59. {snk_cli-0.2.1 → snk_cli-0.3.1}/tests/data/workflow/workflow/profiles/slurm/config.yaml +0 -0
  60. {snk_cli-0.2.1 → snk_cli-0.3.1}/tests/data/workflow/workflow/scripts/hello.py +0 -0
  61. {snk_cli-0.2.1 → snk_cli-0.3.1}/tests/test_cli/__init__.py +0 -0
  62. {snk_cli-0.2.1 → snk_cli-0.3.1}/tests/test_cli/test_dynamic_options.py +0 -0
  63. {snk_cli-0.2.1 → snk_cli-0.3.1}/tests/test_cli/test_run.py +0 -0
  64. {snk_cli-0.2.1 → snk_cli-0.3.1}/tests/test_cli/test_snk_config.py +0 -0
  65. {snk_cli-0.2.1 → snk_cli-0.3.1}/tests/test_cli/test_validate.py +0 -0
  66. {snk_cli-0.2.1 → snk_cli-0.3.1}/tests/test_cli/test_workflow_cli.py +0 -0
  67. {snk_cli-0.2.1 → snk_cli-0.3.1}/tests/test_dynamic_typer.py +0 -0
  68. {snk_cli-0.2.1 → snk_cli-0.3.1}/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.1
3
+ Version: 0.3.1
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
@@ -23,7 +23,7 @@ Requires-Dist: gitpython~=3.1
23
23
  Requires-Dist: makefun~=1.15
24
24
  Requires-Dist: pulp<2.8
25
25
  Requires-Dist: snakemake>=7
26
- Requires-Dist: typer[all]~=0.9.0
26
+ Requires-Dist: typer[all]~=0.9
27
27
  Description-Content-Type: text/markdown
28
28
 
29
29
  # snk-cli
@@ -26,7 +26,7 @@ classifiers = [
26
26
  ]
27
27
  dependencies = [
28
28
  "snakemake>=7",
29
- "typer[all]~=0.9.0",
29
+ "typer[all]~=0.9",
30
30
  "GitPython~=3.1",
31
31
  "pulp<2.8", # Pin pulp <2.8 for snakemake: https://github.com/snakemake/snakemake/issues/2607
32
32
  "art~=5.9",
@@ -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.1"
4
+ __version__ = "0.3.1"
@@ -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]
@@ -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
 
@@ -113,7 +113,9 @@ class ScriptApp(DynamicTyper):
113
113
  ):
114
114
  script_path = self._get_script_path(name)
115
115
  executor = self._get_executor(script_path.suffix[1:])
116
- cmd = [executor, f'"{script_path}"'] + args
116
+ cmd = [executor, f'"{script_path}"']
117
+ if args:
118
+ cmd += args
117
119
  if env:
118
120
  env_path = self._get_conda_env_path(env)
119
121
  env = conda_environment_factory(env_path, self.conda_prefix_dir)
@@ -2,4 +2,4 @@ channels:
2
2
  - bioconda
3
3
  - conda-forge
4
4
  dependencies:
5
- - python=3.9
5
+ - wget
@@ -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