From 735ab2301d0905ea054ad6efa3150acb296d0e78 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20K=C3=B6ster?= Date: Tue, 25 Jan 2022 11:19:07 +0100 Subject: [PATCH] feat: specify conda environments via their name (#1340) * feat: specify conda environments via their name (preparation) * Implement named env support * docs * fix * fmt * fix code smells * Mention wildcard expansion. * add assertion * fix list envs * fix attribute * fix wildcard test * dbg * cleanup * fix test case --- docs/snakefiles/deployment.rst | 33 +++ snakemake/dag.py | 19 +- snakemake/deployment/conda.py | 203 +++++++++++++++--- snakemake/deployment/containerize.py | 4 +- snakemake/executors/__init__.py | 4 +- snakemake/jobs.py | 50 +++-- snakemake/rules.py | 11 +- snakemake/workflow.py | 11 +- tests/test_conda_named/Snakefile | 18 ++ .../expected-results/test.out | 1 + tests/tests.py | 5 + 11 files changed, 289 insertions(+), 70 deletions(-) create mode 100644 tests/test_conda_named/Snakefile create mode 100644 tests/test_conda_named/expected-results/test.out diff --git a/docs/snakefiles/deployment.rst b/docs/snakefiles/deployment.rst index 1ff1f2394..f6856ce45 100644 --- a/docs/snakefiles/deployment.rst +++ b/docs/snakefiles/deployment.rst @@ -246,6 +246,8 @@ with the following `environment definition {output}" diff --git a/tests/test_conda_named/expected-results/test.out b/tests/test_conda_named/expected-results/test.out new file mode 100644 index 000000000..fa1e10f0c --- /dev/null +++ b/tests/test_conda_named/expected-results/test.out @@ -0,0 +1 @@ +ripgrep 13.0.0 diff --git a/tests/tests.py b/tests/tests.py index 9727866bb..c7da69b8c 100644 --- a/tests/tests.py +++ b/tests/tests.py @@ -1392,3 +1392,8 @@ def test_checkpoint_allowed_rules(): @skip_on_windows def test_modules_ruledeps_inheritance(): run(dpath("test_modules_ruledeps_inheritance")) + + +@skip_on_windows +def test_conda_named(): + run(dpath("test_conda_named"), use_conda=True)