snakemake-interface-software-deployment-plugins 0.2.1__tar.gz → 0.2.3__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 (10) hide show
  1. {snakemake_interface_software_deployment_plugins-0.2.1 → snakemake_interface_software_deployment_plugins-0.2.3}/PKG-INFO +1 -1
  2. {snakemake_interface_software_deployment_plugins-0.2.1 → snakemake_interface_software_deployment_plugins-0.2.3}/pyproject.toml +1 -1
  3. {snakemake_interface_software_deployment_plugins-0.2.1 → snakemake_interface_software_deployment_plugins-0.2.3}/snakemake_interface_software_deployment_plugins/__init__.py +3 -2
  4. {snakemake_interface_software_deployment_plugins-0.2.1 → snakemake_interface_software_deployment_plugins-0.2.3}/snakemake_interface_software_deployment_plugins/tests.py +11 -3
  5. {snakemake_interface_software_deployment_plugins-0.2.1 → snakemake_interface_software_deployment_plugins-0.2.3}/LICENSE +0 -0
  6. {snakemake_interface_software_deployment_plugins-0.2.1 → snakemake_interface_software_deployment_plugins-0.2.3}/README.md +0 -0
  7. {snakemake_interface_software_deployment_plugins-0.2.1 → snakemake_interface_software_deployment_plugins-0.2.3}/snakemake_interface_software_deployment_plugins/_common.py +0 -0
  8. {snakemake_interface_software_deployment_plugins-0.2.1 → snakemake_interface_software_deployment_plugins-0.2.3}/snakemake_interface_software_deployment_plugins/registry/__init__.py +0 -0
  9. {snakemake_interface_software_deployment_plugins-0.2.1 → snakemake_interface_software_deployment_plugins-0.2.3}/snakemake_interface_software_deployment_plugins/registry/plugin.py +0 -0
  10. {snakemake_interface_software_deployment_plugins-0.2.1 → snakemake_interface_software_deployment_plugins-0.2.3}/snakemake_interface_software_deployment_plugins/settings.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: snakemake-interface-software-deployment-plugins
3
- Version: 0.2.1
3
+ Version: 0.2.3
4
4
  Summary: This package provides a stable interface for interactions between Snakemake and its software deployment plugins.
5
5
  License: MIT
6
6
  Author: Johannes Köster
@@ -5,7 +5,7 @@ license = "MIT"
5
5
  name = "snakemake-interface-software-deployment-plugins"
6
6
  packages = [{include = "snakemake_interface_software_deployment_plugins"}]
7
7
  readme = "README.md"
8
- version = "0.2.1"
8
+ version = "0.2.3"
9
9
 
10
10
  [tool.poetry.dependencies]
11
11
  argparse-dataclass = "^2.0.0"
@@ -45,6 +45,7 @@ class EnvBase:
45
45
  spec: EnvSpecBase
46
46
  within: Optional["EnvBase"]
47
47
  settings: Optional[SoftwareDeploymentSettingsBase]
48
+ shell_executable: str
48
49
  _managed_hash_store: Optional[str] = field(init=False, default=None)
49
50
  _managed_deployment_hash_store: Optional[str] = field(init=False, default=None)
50
51
  _obj_hash: Optional[int] = field(init=False, default=None)
@@ -64,7 +65,7 @@ class EnvBase:
64
65
  key = (self.__class__, self.within)
65
66
  if key in self._cache:
66
67
  return self._cache[key]
67
- value = func(*args, **kwargs)
68
+ value = func(self, *args, **kwargs)
68
69
  self._cache[key] = value
69
70
  return value
70
71
 
@@ -93,7 +94,7 @@ class EnvBase:
93
94
  """
94
95
  if self.within is not None:
95
96
  cmd = self.within.managed_decorate_shellcmd(cmd)
96
- return sp.run(cmd, shell=True, **kwargs)
97
+ return sp.run(cmd, shell=True, executable=self.shell_executable, **kwargs)
97
98
 
98
99
  def managed_decorate_shellcmd(self, cmd: str) -> str:
99
100
  cmd = self.decorate_shellcmd(cmd)
@@ -20,6 +20,7 @@ _TEST_SDM_NAME = "test-sdm"
20
20
 
21
21
  class TestSoftwareDeploymentBase(ABC):
22
22
  __test__ = False
23
+ shell_executable = "bash"
23
24
 
24
25
  @abstractmethod
25
26
  def get_env_spec(self) -> EnvSpecBase:
@@ -59,13 +60,18 @@ class TestSoftwareDeploymentBase(ABC):
59
60
  cmd = self.get_test_cmd()
60
61
  decorated_cmd = env.managed_decorate_shellcmd(cmd)
61
62
  assert cmd != decorated_cmd
62
- assert sp.run(decorated_cmd, shell=True, executable="bash").returncode == 0
63
+ assert (
64
+ sp.run(
65
+ decorated_cmd, shell=True, executable=self.shell_executable
66
+ ).returncode
67
+ == 0
68
+ )
63
69
 
64
70
  def test_deploy(self, tmp_path):
65
71
  env = self._get_env(tmp_path)
66
72
  self._deploy(env, tmp_path)
67
73
  cmd = env.managed_decorate_shellcmd(self.get_test_cmd())
68
- assert sp.run(cmd, shell=True, executable="bash").returncode == 0
74
+ assert sp.run(cmd, shell=True, executable=self.shell_executable).returncode == 0
69
75
 
70
76
  def test_archive(self, tmp_path):
71
77
  env = self._get_env(tmp_path)
@@ -85,7 +91,9 @@ class TestSoftwareDeploymentBase(ABC):
85
91
  args["deployment_prefix"] = tmp_path / "deployments"
86
92
  if issubclass(env_cls, ArchiveableEnvBase):
87
93
  args["archive_prefix"] = tmp_path / "archives"
88
- return env_cls(spec=spec, within=None, **args)
94
+ return env_cls(
95
+ spec=spec, within=None, shell_executable=self.shell_executable, **args
96
+ )
89
97
 
90
98
  def _deploy(self, env: DeployableEnvBase, tmp_path):
91
99
  if not isinstance(env, DeployableEnvBase):