Skip to content

Commit

Permalink
fix: fix falsely triggered reruns if input files are obtained via wor…
Browse files Browse the repository at this point in the history
…kflow.source_path() (#1862)

### Description

<!--Add a description of your PR here-->

### 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
johanneskoester committed Sep 21, 2022
1 parent 37857d6 commit 2dc2e6a
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion snakemake/persistence.py
Expand Up @@ -20,6 +20,7 @@
from snakemake.logging import logger
from snakemake.jobs import jobfiles
from snakemake.utils import listfiles
from snakemake.io import is_flagged, get_flag_value


class Persistence:
Expand Down Expand Up @@ -419,7 +420,12 @@ def _conda_env(self, job):

@lru_cache()
def _input(self, job):
return sorted(job.input)
get_path = (
lambda f: get_flag_value(f, "sourcecache_entry").get_path_or_uri()
if is_flagged(f, "sourcecache_entry")
else f
)
return sorted(get_path(f) for f in job.input)

@lru_cache()
def _log(self, job):
Expand Down

0 comments on commit 2dc2e6a

Please sign in to comment.