Skip to content

Commit

Permalink
fix: set ignore_incomplete to False in create_conda_envs (#2653)
Browse files Browse the repository at this point in the history
### Description

Potential fix for #2637. 

Edit:
Also adds test case for `conda-create-envs-only`.

### QC
<!-- Make sure that you can tick the boxes below. -->

* [x] The PR contains a test case for the changes or the changes are
already covered by an existing test case.
* [x] The documentation (`docs/`) is updated to reflect the changes or
this is not necessary (e.g. if the change does neither modify the
language nor the behavior or functionalities of Snakemake).
  • Loading branch information
cademirch committed Jan 29, 2024
1 parent ca7a602 commit 4834a42
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 1 deletion.
2 changes: 1 addition & 1 deletion snakemake/workflow.py
Expand Up @@ -988,7 +988,7 @@ def conda_list_envs(self):
def conda_create_envs(self):
self._prepare_dag(
forceall=self.dag_settings.forceall,
ignore_incomplete=self.execution_settings.ignore_incomplete,
ignore_incomplete=False,
lock_warn_only=False,
)
self._build_dag()
Expand Down
3 changes: 3 additions & 0 deletions tests/common.py
Expand Up @@ -192,6 +192,7 @@ def run(
omit_from=frozenset(),
forcerun=frozenset(),
conda_list_envs=False,
conda_create_envs=False,
conda_prefix=None,
wrapper_prefix=None,
printshellcmds=False,
Expand Down Expand Up @@ -379,6 +380,8 @@ def run(
dag_api.create_report(
path=Path(report), stylesheet=report_stylesheet
)
elif conda_create_envs:
dag_api.conda_create_envs()
elif conda_list_envs:
dag_api.conda_list_envs()
elif archive is not None:
Expand Down
16 changes: 16 additions & 0 deletions tests/tests.py
Expand Up @@ -447,6 +447,22 @@ def test_conda_list_envs():
run(dpath("test_conda"), conda_list_envs=True, check_results=False)


def test_conda_create_envs_only():
tmpdir = run(
dpath("test_conda"),
conda_create_envs=True,
check_results=False,
cleanup=False,
cleanup_scripts=False,
)
env_dir = next(
(p for p in Path(tmpdir, ".snakemake", "conda").iterdir() if p.is_dir()), None
)
assert env_dir is not None
assert Path(env_dir, "env_setup_done").exists()
shutil.rmtree(tmpdir)


def test_upstream_conda():
run(
dpath("test_conda"),
Expand Down

0 comments on commit 4834a42

Please sign in to comment.