From 2dc2e6aa3255b8b73e06b7af1ea646d5081799ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20K=C3=B6ster?= Date: Wed, 21 Sep 2022 11:53:00 +0200 Subject: [PATCH] fix: fix falsely triggered reruns if input files are obtained via workflow.source_path() (#1862) ### Description ### QC * [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). --- snakemake/persistence.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/snakemake/persistence.py b/snakemake/persistence.py index a37b74683..ec2e49740 100755 --- a/snakemake/persistence.py +++ b/snakemake/persistence.py @@ -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: @@ -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):