snakemake-interface-software-deployment-plugins 0.16.5__tar.gz → 0.18.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (17) hide show
  1. {snakemake_interface_software_deployment_plugins-0.16.5 → snakemake_interface_software_deployment_plugins-0.18.0}/CHANGELOG.md +19 -0
  2. {snakemake_interface_software_deployment_plugins-0.16.5 → snakemake_interface_software_deployment_plugins-0.18.0}/PKG-INFO +1 -1
  3. {snakemake_interface_software_deployment_plugins-0.16.5 → snakemake_interface_software_deployment_plugins-0.18.0}/pyproject.toml +1 -1
  4. {snakemake_interface_software_deployment_plugins-0.16.5 → snakemake_interface_software_deployment_plugins-0.18.0}/snakemake_interface_software_deployment_plugins/__init__.py +34 -3
  5. {snakemake_interface_software_deployment_plugins-0.16.5 → snakemake_interface_software_deployment_plugins-0.18.0}/snakemake_interface_software_deployment_plugins/registry/__init__.py +2 -4
  6. {snakemake_interface_software_deployment_plugins-0.16.5 → snakemake_interface_software_deployment_plugins-0.18.0}/.github/workflows/conventional-prs.yml +0 -0
  7. {snakemake_interface_software_deployment_plugins-0.16.5 → snakemake_interface_software_deployment_plugins-0.18.0}/.github/workflows/release-please.yml +0 -0
  8. {snakemake_interface_software_deployment_plugins-0.16.5 → snakemake_interface_software_deployment_plugins-0.18.0}/.github/workflows/test.yml +0 -0
  9. {snakemake_interface_software_deployment_plugins-0.16.5 → snakemake_interface_software_deployment_plugins-0.18.0}/.gitignore +0 -0
  10. {snakemake_interface_software_deployment_plugins-0.16.5 → snakemake_interface_software_deployment_plugins-0.18.0}/LICENSE +0 -0
  11. {snakemake_interface_software_deployment_plugins-0.16.5 → snakemake_interface_software_deployment_plugins-0.18.0}/README.md +0 -0
  12. {snakemake_interface_software_deployment_plugins-0.16.5 → snakemake_interface_software_deployment_plugins-0.18.0}/snakemake_interface_software_deployment_plugins/_common.py +0 -0
  13. {snakemake_interface_software_deployment_plugins-0.16.5 → snakemake_interface_software_deployment_plugins-0.18.0}/snakemake_interface_software_deployment_plugins/registry/plugin.py +0 -0
  14. {snakemake_interface_software_deployment_plugins-0.16.5 → snakemake_interface_software_deployment_plugins-0.18.0}/snakemake_interface_software_deployment_plugins/settings.py +0 -0
  15. {snakemake_interface_software_deployment_plugins-0.16.5 → snakemake_interface_software_deployment_plugins-0.18.0}/snakemake_interface_software_deployment_plugins/tests.py +0 -0
  16. {snakemake_interface_software_deployment_plugins-0.16.5 → snakemake_interface_software_deployment_plugins-0.18.0}/tests/test_interface.py +0 -0
  17. {snakemake_interface_software_deployment_plugins-0.16.5 → snakemake_interface_software_deployment_plugins-0.18.0}/tests/test_py37.py +0 -0
@@ -1,5 +1,24 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.18.0](https://github.com/snakemake/snakemake-interface-software-deployment-plugins/compare/v0.17.0...v0.18.0) (2026-06-02)
4
+
5
+
6
+ ### Features
7
+
8
+ * suffix replacement ([#54](https://github.com/snakemake/snakemake-interface-software-deployment-plugins/issues/54)) ([6282e25](https://github.com/snakemake/snakemake-interface-software-deployment-plugins/commit/6282e25b76e389b35921971447b9fdc6af4abcd6))
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * remove debug code ([ffa0804](https://github.com/snakemake/snakemake-interface-software-deployment-plugins/commit/ffa08047257ee3e3e90cde1fe53a5e202c18b02a))
14
+
15
+ ## [0.17.0](https://github.com/snakemake/snakemake-interface-software-deployment-plugins/compare/v0.16.5...v0.17.0) (2026-03-10)
16
+
17
+
18
+ ### Features
19
+
20
+ * allow to select whether within env shall be included in hash ([8b9291d](https://github.com/snakemake/snakemake-interface-software-deployment-plugins/commit/8b9291daddf7a70ddba080ae9ac268a35c8417e1))
21
+
3
22
  ## [0.16.5](https://github.com/snakemake/snakemake-interface-software-deployment-plugins/compare/v0.16.4...v0.16.5) (2026-03-10)
4
23
 
5
24
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: snakemake-interface-software-deployment-plugins
3
- Version: 0.16.5
3
+ Version: 0.18.0
4
4
  Summary: This package provides a stable interface for interactions between Snakemake and its software deployment plugins.
5
5
  Project-URL: repository, https://github.com/snakemake/snakemake-interface-software-deployment-plugins
6
6
  Project-URL: homepage, https://snakemake.github.io
@@ -6,7 +6,7 @@ description = "This package provides a stable interface for interactions between
6
6
  license = "MIT"
7
7
  name = "snakemake-interface-software-deployment-plugins"
8
8
  readme = "README.md"
9
- version = "0.16.5"
9
+ version = "0.18.0"
10
10
  requires-python = ">=3.11,<4.0"
11
11
  dependencies = [
12
12
  "argparse-dataclass >=2.0.0,<3.0",
@@ -33,9 +33,16 @@ from snakemake_interface_common.exceptions import WorkflowError
33
33
  from snakemake_interface_common.software import SoftwareReport
34
34
 
35
35
 
36
+ @dataclass
37
+ class SuffixReplacement:
38
+ old_suffixes: List[str]
39
+ new_suffix: str
40
+
41
+
36
42
  @dataclass
37
43
  class EnvSpecSourceFile:
38
44
  path_or_uri: Union[str, Path]
45
+ suffix_replacement: Optional[SuffixReplacement] = None
39
46
  cached: Optional[Path] = field(repr=False, default=None)
40
47
 
41
48
  def __eq__(self, other) -> bool:
@@ -46,6 +53,18 @@ class EnvSpecSourceFile:
46
53
  def __hash__(self) -> int:
47
54
  return hash(self.path_or_uri)
48
55
 
56
+ def replace_suffix(
57
+ self, suffixes: List[str], new_suffix: str
58
+ ) -> "EnvSpecSourceFile":
59
+ if self.suffix_replacement is not None:
60
+ raise ValueError("Suffix replacement already defined for this source file.")
61
+ return EnvSpecSourceFile(
62
+ path_or_uri=self.path_or_uri,
63
+ suffix_replacement=SuffixReplacement(
64
+ old_suffixes=suffixes, new_suffix=new_suffix
65
+ ),
66
+ )
67
+
49
68
 
50
69
  class EnvSpecBase(ABC):
51
70
  @classmethod
@@ -193,7 +212,7 @@ class EnvBase(ABC):
193
212
  self.within = within
194
213
  self.settings = settings
195
214
  self.shell_executable = shell_executable
196
- self.mountpoints = mountpoints
215
+ self.mountpoints = [mountpoint.absolute() for mountpoint in mountpoints]
197
216
  self.tempdir = tempdir
198
217
  self._deployment_prefix: Path = deployment_prefix
199
218
  self._cache_prefix: Path = cache_prefix
@@ -285,16 +304,28 @@ class EnvBase(ABC):
285
304
  cmd = self.within.managed_decorate_shellcmd(cmd)
286
305
  return cmd
287
306
 
307
+ def hash_include_within(self) -> bool:
308
+ """Return whether the hash of the environment should also reflect the "within"
309
+ environment. Usually, this should be the case, unless you have a particular
310
+ reason. For the conda plugin, we overwrite this in case of containerized
311
+ environments.
312
+ """
313
+ return True
314
+
288
315
  def hash(self) -> str:
289
316
  return self._managed_generic_hash("hash")
290
317
 
318
+ def clear_hashes(self) -> None:
319
+ self._managed_hash_store = None
320
+ self._managed_deployment_hash_store = None
321
+
291
322
  def _managed_generic_hash(self, kind: str) -> str:
292
323
  store_attr = f"_managed_{kind}_store"
293
324
  store = getattr(self, store_attr)
294
325
  if store is None:
295
326
  record_hash = f"record_{kind}"
296
- hash_object = hashlib.md5()
297
- if self.within is not None:
327
+ hash_object = hashlib.md5(usedforsecurity=False)
328
+ if self.within is not None and self.hash_include_within():
298
329
  # For within, we always take the normal hash,
299
330
  # since the deployment just runs within that.
300
331
  self.within.record_hash(hash_object)
@@ -36,9 +36,7 @@ class SoftwareDeploymentPluginRegistry(PluginRegistryBase):
36
36
  return Plugin(
37
37
  _name=name,
38
38
  common_settings=module.common_settings,
39
- _software_deployment_settings_cls=getattr(
40
- module, "SoftwareDeploymentSettings", None
41
- ),
39
+ _software_deployment_settings_cls=getattr(module, "Settings", None),
42
40
  _env_cls=module.EnvBase,
43
41
  _env_spec_cls=module.EnvSpecBase,
44
42
  )
@@ -50,7 +48,7 @@ class SoftwareDeploymentPluginRegistry(PluginRegistryBase):
50
48
  mode=AttributeMode.REQUIRED,
51
49
  kind=AttributeKind.OBJECT,
52
50
  ),
53
- "SoftwareDeploymentSettings": AttributeType(
51
+ "Settings": AttributeType(
54
52
  cls=SoftwareDeploymentSettingsBase,
55
53
  mode=AttributeMode.OPTIONAL,
56
54
  kind=AttributeKind.CLASS,