From 0825a29e46c08b200efe6bd0c66acf1e6828eed8 Mon Sep 17 00:00:00 2001 From: Jan Forster <31272349+jafors@users.noreply.github.com> Date: Wed, 20 Oct 2021 21:16:26 +0200 Subject: [PATCH] fix: caching process (#1225) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * generalization of multiext output * Reformatting * Fixed caching of jobs/rules * FMT * Moved encoding into hash update Co-authored-by: Johannes Köster --- snakemake/caching/hash.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/snakemake/caching/hash.py b/snakemake/caching/hash.py index c84e3721a..ffa40730e 100644 --- a/snakemake/caching/hash.py +++ b/snakemake/caching/hash.py @@ -57,7 +57,7 @@ def _get_provenance_hash(self, job: Job): wildcards=job.wildcards, params=job.params, ) - h.update(source) + h.update(source.encode()) elif job.is_notebook: _, source, _, _ = script.get_source( job.rule.notebook, @@ -66,16 +66,20 @@ def _get_provenance_hash(self, job: Job): wildcards=job.wildcards, params=job.params, ) - h.update(source) + h.update(source.encode()) elif job.is_wrapper: _, source, _, _ = script.get_source( - wrapper.get_script(job.rule.wrapper, prefix=workflow.wrapper_prefix), + wrapper.get_script( + job.rule.wrapper, + sourcecahce=job.rule.workflow.sourcecache, + prefix=workflow.wrapper_prefix, + ), job.rule.workflow.sourcecache, basedir=job.rule.basedir, wildcards=job.wildcards, params=job.params, ) - h.update(source) + h.update(source.encode()) # Hash params. for key, value in sorted(job.params._allitems()):