Skip to content

Commit 89d45d8

Browse files
fix: hash building for enclosed environments and deployment test (#38)
1 parent d953afe commit 89d45d8

2 files changed

Lines changed: 7 additions & 3 deletions

File tree

snakemake_interface_software_deployment_plugins/__init__.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -272,14 +272,18 @@ def hash(self) -> str:
272272
return self._managed_generic_hash("hash")
273273

274274
def _managed_generic_hash(self, kind: str) -> str:
275-
store = getattr(self, f"_managed_{kind}_store")
275+
store_attr = f"_managed_{kind}_store"
276+
store = getattr(self, store_attr)
276277
if store is None:
277278
record_hash = f"record_{kind}"
278279
hash_object = hashlib.md5()
279280
if self.within is not None:
280-
getattr(self.within, record_hash)(hash_object)
281+
# For within, we always take the normal hash,
282+
# since the deployment just runs within that.
283+
self.within.record_hash(hash_object)
281284
getattr(self, record_hash)(hash_object)
282285
store = hash_object.hexdigest()
286+
setattr(self, store_attr, store)
283287
return store
284288

285289
def __hash__(self) -> int:

snakemake_interface_software_deployment_plugins/tests.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ def test_deploy(self, tmp_path):
9292
env = self._get_env(tmp_path)
9393
self._deploy(env, tmp_path)
9494
cmd = env.managed_decorate_shellcmd(self.get_test_cmd())
95-
assert env.run_cmd(cmd).returncode == 0
95+
assert self.shell_executable.run(cmd).returncode == 0
9696

9797
def test_cache(self, tmp_path):
9898
env = self._get_env(tmp_path)

0 commit comments

Comments
 (0)