Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions snakemake_interface_software_deployment_plugins/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -272,14 +272,18 @@ def hash(self) -> str:
return self._managed_generic_hash("hash")

def _managed_generic_hash(self, kind: str) -> str:
store = getattr(self, f"_managed_{kind}_store")
store_attr = f"_managed_{kind}_store"
store = getattr(self, store_attr)
if store is None:
record_hash = f"record_{kind}"
hash_object = hashlib.md5()
if self.within is not None:
getattr(self.within, record_hash)(hash_object)
# For within, we always take the normal hash,
# since the deployment just runs within that.
self.within.record_hash(hash_object)
getattr(self, record_hash)(hash_object)
store = hash_object.hexdigest()
setattr(self, store_attr, store)
return store

def __hash__(self) -> int:
Expand Down
2 changes: 1 addition & 1 deletion snakemake_interface_software_deployment_plugins/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ def test_deploy(self, tmp_path):
env = self._get_env(tmp_path)
self._deploy(env, tmp_path)
cmd = env.managed_decorate_shellcmd(self.get_test_cmd())
assert env.run_cmd(cmd).returncode == 0
assert self.shell_executable.run(cmd).returncode == 0

def test_cache(self, tmp_path):
env = self._get_env(tmp_path)
Expand Down