snk-cli 0.5.2__tar.gz → 0.5.3__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.5.2 → snk_cli-0.5.3}/PKG-INFO +1 -1
- {snk_cli-0.5.2 → snk_cli-0.5.3}/src/snk_cli/__about__.py +1 -1
- {snk_cli-0.5.2 → snk_cli-0.5.3}/src/snk_cli/cli.py +1 -1
- {snk_cli-0.5.2 → snk_cli-0.5.3}/src/snk_cli/subcommands/config.py +1 -1
- {snk_cli-0.5.2 → snk_cli-0.5.3}/src/snk_cli/subcommands/env.py +1 -1
- {snk_cli-0.5.2 → snk_cli-0.5.3}/src/snk_cli/subcommands/profile.py +1 -1
- {snk_cli-0.5.2 → snk_cli-0.5.3}/src/snk_cli/subcommands/run.py +16 -23
- {snk_cli-0.5.2 → snk_cli-0.5.3}/src/snk_cli/subcommands/script.py +1 -1
- {snk_cli-0.5.2 → snk_cli-0.5.3}/.github/workflows/publish.yml +0 -0
- {snk_cli-0.5.2 → snk_cli-0.5.3}/.github/workflows/tests.yml +0 -0
- {snk_cli-0.5.2 → snk_cli-0.5.3}/.gitignore +0 -0
- {snk_cli-0.5.2 → snk_cli-0.5.3}/LICENSE.txt +0 -0
- {snk_cli-0.5.2 → snk_cli-0.5.3}/README.md +0 -0
- {snk_cli-0.5.2 → snk_cli-0.5.3}/docs/index.md +0 -0
- {snk_cli-0.5.2 → snk_cli-0.5.3}/docs/reference/cli.md +0 -0
- {snk_cli-0.5.2 → snk_cli-0.5.3}/docs/reference/config.md +0 -0
- {snk_cli-0.5.2 → snk_cli-0.5.3}/docs/reference/dynamic_typer.md +0 -0
- {snk_cli-0.5.2 → snk_cli-0.5.3}/docs/reference/options.md +0 -0
- {snk_cli-0.5.2 → snk_cli-0.5.3}/docs/reference/subcommands.md +0 -0
- {snk_cli-0.5.2 → snk_cli-0.5.3}/docs/reference/testing.md +0 -0
- {snk_cli-0.5.2 → snk_cli-0.5.3}/docs/reference/utils.md +0 -0
- {snk_cli-0.5.2 → snk_cli-0.5.3}/docs/reference/validate.md +0 -0
- {snk_cli-0.5.2 → snk_cli-0.5.3}/docs/reference/workflow.md +0 -0
- {snk_cli-0.5.2 → snk_cli-0.5.3}/mkdocs.yml +0 -0
- {snk_cli-0.5.2 → snk_cli-0.5.3}/pyproject.toml +0 -0
- {snk_cli-0.5.2 → snk_cli-0.5.3}/src/snk_cli/__init__.py +0 -0
- {snk_cli-0.5.2 → snk_cli-0.5.3}/src/snk_cli/conda.py +0 -0
- {snk_cli-0.5.2 → snk_cli-0.5.3}/src/snk_cli/config/__init__.py +0 -0
- {snk_cli-0.5.2 → snk_cli-0.5.3}/src/snk_cli/config/config.py +0 -0
- {snk_cli-0.5.2 → snk_cli-0.5.3}/src/snk_cli/config/utils.py +0 -0
- {snk_cli-0.5.2 → snk_cli-0.5.3}/src/snk_cli/dynamic_typer.py +0 -0
- {snk_cli-0.5.2 → snk_cli-0.5.3}/src/snk_cli/options/__init__.py +0 -0
- {snk_cli-0.5.2 → snk_cli-0.5.3}/src/snk_cli/options/option.py +0 -0
- {snk_cli-0.5.2 → snk_cli-0.5.3}/src/snk_cli/options/utils.py +0 -0
- {snk_cli-0.5.2 → snk_cli-0.5.3}/src/snk_cli/subcommands/__init__.py +0 -0
- {snk_cli-0.5.2 → snk_cli-0.5.3}/src/snk_cli/testing.py +0 -0
- {snk_cli-0.5.2 → snk_cli-0.5.3}/src/snk_cli/utils.py +0 -0
- {snk_cli-0.5.2 → snk_cli-0.5.3}/src/snk_cli/validate.py +0 -0
- {snk_cli-0.5.2 → snk_cli-0.5.3}/src/snk_cli/workflow.py +0 -0
- {snk_cli-0.5.2 → snk_cli-0.5.3}/tests/__init__.py +0 -0
- {snk_cli-0.5.2 → snk_cli-0.5.3}/tests/conftest.py +0 -0
- {snk_cli-0.5.2 → snk_cli-0.5.3}/tests/data/artic_v4.1.bed +0 -0
- {snk_cli-0.5.2 → snk_cli-0.5.3}/tests/data/config.yaml +0 -0
- {snk_cli-0.5.2 → snk_cli-0.5.3}/tests/data/cov.fasta +0 -0
- {snk_cli-0.5.2 → snk_cli-0.5.3}/tests/data/print_config/Snakefile +0 -0
- {snk_cli-0.5.2 → snk_cli-0.5.3}/tests/data/print_config/cli.py +0 -0
- {snk_cli-0.5.2 → snk_cli-0.5.3}/tests/data/print_config/config.yaml +0 -0
- {snk_cli-0.5.2 → snk_cli-0.5.3}/tests/data/print_config/snk.yaml +0 -0
- {snk_cli-0.5.2 → snk_cli-0.5.3}/tests/data/workflow/cli.py +0 -0
- {snk_cli-0.5.2 → snk_cli-0.5.3}/tests/data/workflow/config.yaml +0 -0
- {snk_cli-0.5.2 → snk_cli-0.5.3}/tests/data/workflow/resources/data.txt +0 -0
- {snk_cli-0.5.2 → snk_cli-0.5.3}/tests/data/workflow/snk.yaml +0 -0
- {snk_cli-0.5.2 → snk_cli-0.5.3}/tests/data/workflow/things/__about__.py +0 -0
- {snk_cli-0.5.2 → snk_cli-0.5.3}/tests/data/workflow/workflow/Snakefile +0 -0
- {snk_cli-0.5.2 → snk_cli-0.5.3}/tests/data/workflow/workflow/envs/wget.yml +0 -0
- {snk_cli-0.5.2 → snk_cli-0.5.3}/tests/data/workflow/workflow/profiles/base/config.yaml +0 -0
- {snk_cli-0.5.2 → snk_cli-0.5.3}/tests/data/workflow/workflow/profiles/slurm/config.yaml +0 -0
- {snk_cli-0.5.2 → snk_cli-0.5.3}/tests/data/workflow/workflow/scripts/hello.py +0 -0
- {snk_cli-0.5.2 → snk_cli-0.5.3}/tests/test_SnkConfig.py +0 -0
- {snk_cli-0.5.2 → snk_cli-0.5.3}/tests/test_cli/__init__.py +0 -0
- {snk_cli-0.5.2 → snk_cli-0.5.3}/tests/test_cli/test_dynamic_options.py +0 -0
- {snk_cli-0.5.2 → snk_cli-0.5.3}/tests/test_cli/test_profile.py +0 -0
- {snk_cli-0.5.2 → snk_cli-0.5.3}/tests/test_cli/test_run.py +0 -0
- {snk_cli-0.5.2 → snk_cli-0.5.3}/tests/test_cli/test_snk_config.py +0 -0
- {snk_cli-0.5.2 → snk_cli-0.5.3}/tests/test_cli/test_subcommands.py +0 -0
- {snk_cli-0.5.2 → snk_cli-0.5.3}/tests/test_cli/test_validate.py +0 -0
- {snk_cli-0.5.2 → snk_cli-0.5.3}/tests/test_cli/test_workflow_cli.py +0 -0
- {snk_cli-0.5.2 → snk_cli-0.5.3}/tests/test_conda_env.py +0 -0
- {snk_cli-0.5.2 → snk_cli-0.5.3}/tests/test_dynamic_typer.py +0 -0
- {snk_cli-0.5.2 → snk_cli-0.5.3}/tests/utils.py +0 -0
|
@@ -259,5 +259,5 @@ class CLI(DynamicTyper):
|
|
|
259
259
|
info_dict["conda_prefix_dir"] = str(self.conda_prefix_dir)
|
|
260
260
|
info_dict["singularity_prefix_dir"] = str(self.singularity_prefix_dir)
|
|
261
261
|
info_dict["workflow_dir_path"] = str(self.workflow.path)
|
|
262
|
-
|
|
262
|
+
self.echo(json.dumps(info_dict, indent=2))
|
|
263
263
|
|
|
@@ -213,10 +213,9 @@ class RunApp(DynamicTyper):
|
|
|
213
213
|
# Set up conda frontend
|
|
214
214
|
conda_found = check_command_available("conda")
|
|
215
215
|
if not conda_found and verbose:
|
|
216
|
-
|
|
216
|
+
self.log(
|
|
217
217
|
"Conda not found! Install conda to use environments.\n",
|
|
218
|
-
|
|
219
|
-
err=True,
|
|
218
|
+
color=typer.colors.MAGENTA,
|
|
220
219
|
)
|
|
221
220
|
|
|
222
221
|
if conda_found and self.snk_config.conda and not no_conda:
|
|
@@ -228,10 +227,9 @@ class RunApp(DynamicTyper):
|
|
|
228
227
|
)
|
|
229
228
|
if not check_command_available("mamba"):
|
|
230
229
|
if verbose:
|
|
231
|
-
|
|
230
|
+
self.log(
|
|
232
231
|
"Could not find mamba, using conda instead...",
|
|
233
|
-
|
|
234
|
-
err=True,
|
|
232
|
+
color=typer.colors.MAGENTA,
|
|
235
233
|
)
|
|
236
234
|
args.append("--conda-frontend=conda")
|
|
237
235
|
else:
|
|
@@ -260,7 +258,7 @@ class RunApp(DynamicTyper):
|
|
|
260
258
|
if configs:
|
|
261
259
|
args.extend(["--config", *configs])
|
|
262
260
|
if verbose:
|
|
263
|
-
|
|
261
|
+
self.log(f"snakemake {' '.join(args)}\n", color=typer.colors.MAGENTA)
|
|
264
262
|
if not keep_snakemake and Path(".snakemake").exists():
|
|
265
263
|
keep_snakemake = True
|
|
266
264
|
try:
|
|
@@ -281,7 +279,7 @@ class RunApp(DynamicTyper):
|
|
|
281
279
|
if status:
|
|
282
280
|
sys.exit(status)
|
|
283
281
|
if not keep_snakemake and Path(".snakemake").exists():
|
|
284
|
-
|
|
282
|
+
self.log("Cleaning up '.snakemake' folder... use --keep-snakemake to keep.")
|
|
285
283
|
shutil.rmtree(".snakemake")
|
|
286
284
|
|
|
287
285
|
def _save_dag(self, snakemake_args: List[str], filename: Path):
|
|
@@ -320,11 +318,10 @@ class RunApp(DynamicTyper):
|
|
|
320
318
|
)
|
|
321
319
|
with open(filename, "w") as output_file:
|
|
322
320
|
if self.verbose:
|
|
323
|
-
|
|
321
|
+
self.log(f"Saving dag to {filename}", color=typer.colors.MAGENTA)
|
|
324
322
|
subprocess.run(["cat"], stdin=dot_process.stdout, stdout=output_file)
|
|
325
323
|
except (subprocess.CalledProcessError, FileNotFoundError):
|
|
326
|
-
|
|
327
|
-
raise typer.Exit(1)
|
|
324
|
+
self.error("Graphviz `dot` command not found! Please install.", exit=True)
|
|
328
325
|
|
|
329
326
|
@contextmanager
|
|
330
327
|
def _copy_resources(
|
|
@@ -355,10 +352,9 @@ class RunApp(DynamicTyper):
|
|
|
355
352
|
|
|
356
353
|
def copy_resource(src: Path, dst: Path, symlink: bool = False):
|
|
357
354
|
if self.verbose:
|
|
358
|
-
|
|
355
|
+
self.log(
|
|
359
356
|
f" - Copying resource '{src}' to '{dst}'",
|
|
360
|
-
|
|
361
|
-
err=True,
|
|
357
|
+
color=typer.colors.MAGENTA,
|
|
362
358
|
)
|
|
363
359
|
target_is_directory = src.is_dir()
|
|
364
360
|
if symlink:
|
|
@@ -380,10 +376,9 @@ class RunApp(DynamicTyper):
|
|
|
380
376
|
if resources_folder.exists():
|
|
381
377
|
resources.insert(0, Path("resources"))
|
|
382
378
|
if self.verbose and resources:
|
|
383
|
-
|
|
379
|
+
self.log(
|
|
384
380
|
f"Copying {len(resources)} resources to working directory...",
|
|
385
|
-
|
|
386
|
-
err=True,
|
|
381
|
+
color=typer.colors.MAGENTA
|
|
387
382
|
)
|
|
388
383
|
try:
|
|
389
384
|
for resource in resources:
|
|
@@ -394,10 +389,9 @@ class RunApp(DynamicTyper):
|
|
|
394
389
|
copy_resource(abs_path, destination, symlink=symlink_resources)
|
|
395
390
|
copied_resources.append(destination)
|
|
396
391
|
elif self.verbose:
|
|
397
|
-
|
|
392
|
+
self.log(
|
|
398
393
|
f" - Resource '{resource.name}' already exists! Skipping...",
|
|
399
|
-
|
|
400
|
-
err=True,
|
|
394
|
+
color=typer.colors.MAGENTA,
|
|
401
395
|
)
|
|
402
396
|
yield
|
|
403
397
|
finally:
|
|
@@ -406,10 +400,9 @@ class RunApp(DynamicTyper):
|
|
|
406
400
|
for copied_resource in copied_resources:
|
|
407
401
|
if copied_resource.exists():
|
|
408
402
|
if self.verbose:
|
|
409
|
-
|
|
403
|
+
self.log(
|
|
410
404
|
f"Deleting '{copied_resource.name}' resource...",
|
|
411
|
-
|
|
412
|
-
err=True,
|
|
405
|
+
color=typer.colors.MAGENTA,
|
|
413
406
|
)
|
|
414
407
|
remove_resource(copied_resource)
|
|
415
408
|
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|