From 9f701463ae84d9f8eac022d04d423025ce625d05 Mon Sep 17 00:00:00 2001 From: Johannes Koester Date: Mon, 15 Sep 2025 10:27:30 +0200 Subject: [PATCH 01/19] fix: update to latest interface --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 8720d46..6dd0a72 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ version = "0.1.4" description = "" readme = "README.md" requires-python = ">=3.11,<4.0" -dependencies = ["snakemake-interface-software-deployment-plugins >=0.6.1,<1.0.0"] +dependencies = ["snakemake-interface-software-deployment-plugins >=0.7.5,<1.0.0"] repository = "https://github.com/your/plugin" documentation = "https://snakemake.github.io/snakemake-plugin-catalog/plugins/software-deployment/envmodules.html" [[project.authors]] From f43a6e0226ef85115fd7e23a0701e9b60dbf02f2 Mon Sep 17 00:00:00 2001 From: Johannes Koester Date: Mon, 15 Sep 2025 16:00:19 +0200 Subject: [PATCH 02/19] migrate to pixi --- .github/workflows/ci.yml | 64 ++++++++--------------- .github/workflows/release-please.yml | 33 ++++-------- .gitignore | 2 +- pyproject.toml | 76 +++++++++++++++++++++------- 4 files changed, 89 insertions(+), 86 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7d7e7fd..1f06515 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -6,62 +6,38 @@ on: - main pull_request: -env: - PYTHON_VERSION: 3.11 - jobs: - linting: + formatting: runs-on: ubuntu-latest steps: - name: Check out the code - uses: actions/checkout@v3 - - - uses: actions/setup-python@v4 - with: - python-version: ${{ env.PYTHON_VERSION }} - - - name: Install poetry - run: pip install poetry + uses: actions/checkout@v5 - - name: Determine dependencies - run: poetry lock - - - uses: actions/setup-python@v4 - with: - python-version: ${{ env.PYTHON_VERSION }} - cache: poetry - - - name: Install Dependencies using Poetry - run: poetry install + - name: Setup pixi + uses: prefix-dev/setup-pixi@v0 - name: Check formatting - run: poetry run ruff format --check . - - - name: Lint - run: poetry run ruff check . + run: pixi run format --check . - testing: + linting: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - - uses: actions/setup-python@v4 - with: - python-version: ${{ env.PYTHON_VERSION }} + - name: Check out the code + uses: actions/checkout@v5 - - name: Install poetry - run: pip install poetry + - name: Setup pixi + uses: prefix-dev/setup-pixi@v0 - - name: Determine dependencies - run: poetry lock + - name: Check code + run: pixi run lint - - uses: actions/setup-python@v4 - with: - python-version: ${{ env.PYTHON_VERSION }} - cache: poetry + testing: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v5 - - name: Install dependencies - run: poetry install + - name: Setup pixi + uses: prefix-dev/setup-pixi@v0 - name: Setup envmodules run: | @@ -72,7 +48,7 @@ jobs: run: | source /etc/profile.d/modules.sh module --help - poetry run coverage run -m pytest + pixi run test -v - name: Run Coverage - run: poetry run coverage report -m + run: pixi run coverage-report diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml index 76eaa51..658ae7d 100644 --- a/.github/workflows/release-please.yml +++ b/.github/workflows/release-please.yml @@ -18,36 +18,23 @@ jobs: id: release with: release-type: python - package-name: publish: runs-on: ubuntu-latest needs: release-please if: ${{ needs.release-please.outputs.release_created }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v5 - - uses: actions/setup-python@v4 - with: - python-version: ${{ env.PYTHON_VERSION }} - - - name: Install poetry - run: pip install poetry - - - name: Determine dependencies - run: poetry lock + - name: Setup pixi + uses: prefix-dev/setup-pixi@v0 - - uses: actions/setup-python@v4 - with: - python-version: ${{ env.PYTHON_VERSION }} - cache: poetry - - - name: Install Dependencies using Poetry + - name: Build source and wheel distribution + check build run: | - poetry install + pixi run check-build - - name: Publish to PyPi - env: - PYPI_USERNAME: __token__ - PYPI_PASSWORD: ${{ secrets.PYPI_TOKEN }} - run: poetry publish --build --username $PYPI_USERNAME --password $PYPI_PASSWORD + - name: Publish to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 + with: + user: __token__ + password: ${{ secrets.PYPI_TOKEN }} diff --git a/.gitignore b/.gitignore index bcc3d59..d2b486f 100644 --- a/.gitignore +++ b/.gitignore @@ -159,4 +159,4 @@ cython_debug/ # option (not recommended) you can uncomment the following to ignore the entire idea folder. #.idea/ -poetry.lock \ No newline at end of file +pixi.lock \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index 6dd0a72..629e5c2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,26 +1,66 @@ [project] name = "snakemake-software-deployment-plugin-envmodules" version = "0.1.4" -description = "" +authors = [{ name = "Johannes Köster", email = "johannes.koester@uni-due.de" }] +description = "Software deployment plugin for Snakemake using environment modules." readme = "README.md" requires-python = ">=3.11,<4.0" -dependencies = ["snakemake-interface-software-deployment-plugins >=0.7.5,<1.0.0"] -repository = "https://github.com/your/plugin" +dependencies = [ + "snakemake-interface-common (>=1.17.4,<2.0.0)", + "snakemake-interface-software-deployment-plugins (>=0.7.5,<1.0)", +] + +[tool.pixi.pypi-dependencies] +snakemake-software-deployment-plugin-envmodules = { path = ".", editable = true } + +[project.urls] +repository = "https://github.com/snakemake/snakemake-software-deployment-plugin-envmodules" documentation = "https://snakemake.github.io/snakemake-plugin-catalog/plugins/software-deployment/envmodules.html" -[[project.authors]] -name = "Johannes Koester" -email = "johannes.koester@uni-due.de" [build-system] -requires = [ "poetry-core>=2.0.0,<3.0.0",] -build-backend = "poetry.core.masonry.api" - -[tool.poetry] -[[tool.poetry.packages]] -include = "snakemake_software_deployment_plugin_envmodules" -from = "src" - -[tool.poetry.group.dev.dependencies] -coverage = "^7.6.12" -pytest = "^8.3.5" -ruff = "^0.9.9" +requires = ["hatchling"] +build-backend = "hatchling.build" + +[tool.pixi.project] +channels = ["conda-forge"] +platforms = ["osx-arm64", "linux-64"] + +[tool.pixi.environments] +dev = { features = ["dev"] } +publish = { features = ["publish"] } + +[tool.pixi.feature.dev.dependencies] +pytest = ">=8.3.5,<9" +ruff = ">=0.10.0,<0.11" +pytest-cov = ">=6.0.0,<7" + +[tool.pixi.feature.dev.tasks] +format = "ruff format" +lint = "ruff check" +qc = { depends-on = ["format", "lint"] } +coverage-report = "coverage report -m" + +[tool.pixi.feature.dev.tasks.test] +cmd = [ + "pytest", + "--cov=snakemake_software_deployment_plugin_conda", + "--cov-report=xml:coverage-report/coverage.xml", + "--cov-report=term-missing", + "tests/test_plugin.py", +] + +[tool.coverage.report] +exclude_lines = ["pass", "\\.\\.\\."] +fail_under = 70.0 + +# Publish +[tool.pixi.feature.publish.dependencies] +twine = ">=6.1.0,<7" +python-build = ">=1.2.2,<2" + + +[tool.pixi.feature.publish.tasks] +build = { cmd = "python -m build", description = "Build the package into the dist/ directory" } +check-build = { cmd = "python -m twine check dist/*", depends-on = [ + "build", +], description = "Check that the package can be uploaded" } From 5ba379a7852ef1062c8e57b85a72b6dd86ee9ce7 Mon Sep 17 00:00:00 2001 From: Johannes Koester Date: Mon, 15 Sep 2025 16:04:28 +0200 Subject: [PATCH 03/19] fix --- pyproject.toml | 2 +- tests/test_plugin.py | 17 ++++++++++++++--- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 629e5c2..1e59784 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -43,7 +43,7 @@ coverage-report = "coverage report -m" [tool.pixi.feature.dev.tasks.test] cmd = [ "pytest", - "--cov=snakemake_software_deployment_plugin_conda", + "--cov=snakemake_software_deployment_plugin_envmodules", "--cov-report=xml:coverage-report/coverage.xml", "--cov-report=term-missing", "tests/test_plugin.py", diff --git a/tests/test_plugin.py b/tests/test_plugin.py index b27bb8b..416c0fd 100644 --- a/tests/test_plugin.py +++ b/tests/test_plugin.py @@ -1,18 +1,18 @@ import os from typing import Optional, Type -from snakemake_interface_software_deployment_plugins import EnvBase +from snakemake_interface_software_deployment_plugins import EnvBase, EnvSpecBase from snakemake_interface_software_deployment_plugins.tests import ( TestSoftwareDeploymentBase, ) from snakemake_interface_software_deployment_plugins.settings import ( SoftwareDeploymentSettingsBase, ) -from snakemake_software_deployment_plugin_envmodules import Env, EnvSpec, EnvSpecBase +from snakemake_software_deployment_plugin_envmodules import Env, EnvSpec os.environ["MODULEPATH"] = "tests/modules" -class TestSoftwareDeployment(TestSoftwareDeploymentBase): +class Test(TestSoftwareDeploymentBase): __test__ = True # activate automatic testing def get_software_deployment_provider_settings( @@ -30,6 +30,17 @@ def get_env_spec(self) -> EnvSpecBase: # testing. return EnvSpec("somecmd") + def get_settings_cls(self) -> Optional[Type[SoftwareDeploymentSettingsBase]]: + # Return the settings class that should be used for this plugin. + return None + + def get_settings( + self, + ) -> Optional[SoftwareDeploymentSettingsBase]: + # If your plugin has settings, return a valid settings object here. + # Otherwise, return None. + return None + def get_test_cmd(self) -> str: # Return a command that should be executable without error in the environment return "somecmd" From 567346ca9ba97f648f0ac307faaa4bbcd65b3b43 Mon Sep 17 00:00:00 2001 From: Johannes Koester Date: Mon, 15 Sep 2025 16:14:53 +0200 Subject: [PATCH 04/19] dbg --- pyproject.toml | 3 ++- .../__init__.py | 7 +++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 1e59784..6627459 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -7,11 +7,12 @@ readme = "README.md" requires-python = ">=3.11,<4.0" dependencies = [ "snakemake-interface-common (>=1.17.4,<2.0.0)", - "snakemake-interface-software-deployment-plugins (>=0.7.5,<1.0)", + #"snakemake-interface-software-deployment-plugins (>=0.7.5,<1.0)", ] [tool.pixi.pypi-dependencies] snakemake-software-deployment-plugin-envmodules = { path = ".", editable = true } +snakemake-interface-software-deployment-plugins = { path = "../snakemake-interface-software-deployment-plugins", editable = true } [project.urls] repository = "https://github.com/snakemake/snakemake-software-deployment-plugin-envmodules" diff --git a/src/snakemake_software_deployment_plugin_envmodules/__init__.py b/src/snakemake_software_deployment_plugin_envmodules/__init__.py index a71c45c..b65e959 100644 --- a/src/snakemake_software_deployment_plugin_envmodules/__init__.py +++ b/src/snakemake_software_deployment_plugin_envmodules/__init__.py @@ -24,6 +24,9 @@ def identity_attributes(self) -> Iterable[str]: def source_path_attributes(self) -> Iterable[str]: # no paths involved here return () + + def __str__(self) -> str: + return ",".join(self.names) class Env(EnvBase): @@ -36,7 +39,7 @@ def check(self) -> None: if self.run_cmd("type module", stdout=sp.PIPE, stderr=sp.PIPE).returncode != 0: raise WorkflowError( "The module command is not available. " - "Please make sure that the environment modules are " + "Please make sure that environment modules are " "available on your system." ) @@ -45,7 +48,7 @@ def decorate_shellcmd(self, cmd: str) -> str: # Unclear why that happens. # one might have to say 'shopt -s expand_aliases;', but that did not # help either... - return f"module purge && module load {' '.join(self.spec.names)}; {cmd}" + return f"module purge && module load {' '.join(self.spec.names)} && {cmd}" def record_hash(self, hash_object) -> None: # We just hash the names here as the best thing we can do for envmodules From c960c82c95424aeff9bc593dc03ebb1f8a0963fd Mon Sep 17 00:00:00 2001 From: Johannes Koester Date: Mon, 15 Sep 2025 16:15:38 +0200 Subject: [PATCH 05/19] fix --- pyproject.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 6627459..31f2523 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -7,12 +7,12 @@ readme = "README.md" requires-python = ">=3.11,<4.0" dependencies = [ "snakemake-interface-common (>=1.17.4,<2.0.0)", - #"snakemake-interface-software-deployment-plugins (>=0.7.5,<1.0)", + "snakemake-interface-software-deployment-plugins (>=0.7.5,<1.0)", ] [tool.pixi.pypi-dependencies] snakemake-software-deployment-plugin-envmodules = { path = ".", editable = true } -snakemake-interface-software-deployment-plugins = { path = "../snakemake-interface-software-deployment-plugins", editable = true } +#snakemake-interface-software-deployment-plugins = { path = "../snakemake-interface-software-deployment-plugins", editable = true } [project.urls] repository = "https://github.com/snakemake/snakemake-software-deployment-plugin-envmodules" From f8d3425a93246b336fca700b4ffeb363f3d362ee Mon Sep 17 00:00:00 2001 From: Johannes Koester Date: Mon, 15 Sep 2025 16:17:39 +0200 Subject: [PATCH 06/19] fix --- src/snakemake_software_deployment_plugin_envmodules/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/snakemake_software_deployment_plugin_envmodules/__init__.py b/src/snakemake_software_deployment_plugin_envmodules/__init__.py index b65e959..ca1a8fe 100644 --- a/src/snakemake_software_deployment_plugin_envmodules/__init__.py +++ b/src/snakemake_software_deployment_plugin_envmodules/__init__.py @@ -15,7 +15,7 @@ class EnvSpec(EnvSpecBase): def __init__(self, *names: str): super().__init__() - self.names: Tuple[str] = names + self.names: tuple[str, ...] = tuple(names) def identity_attributes(self) -> Iterable[str]: # The identity of the env spec is given by the names of the modules. From eaabff1ceb5936ec78f5cf70b5faa722a8d57502 Mon Sep 17 00:00:00 2001 From: Johannes Koester Date: Mon, 15 Sep 2025 16:36:09 +0200 Subject: [PATCH 07/19] dbg --- .github/workflows/ci.yml | 1 + .../__init__.py | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1f06515..44c8699 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -45,6 +45,7 @@ jobs: sudo apt-get install -y environment-modules - name: Run pytest + shell: bash run: | source /etc/profile.d/modules.sh module --help diff --git a/src/snakemake_software_deployment_plugin_envmodules/__init__.py b/src/snakemake_software_deployment_plugin_envmodules/__init__.py index ca1a8fe..94e99e5 100644 --- a/src/snakemake_software_deployment_plugin_envmodules/__init__.py +++ b/src/snakemake_software_deployment_plugin_envmodules/__init__.py @@ -1,4 +1,4 @@ -from typing import Iterable, Tuple +from typing import Iterable import subprocess as sp from snakemake_interface_software_deployment_plugins import ( EnvBase, @@ -24,7 +24,7 @@ def identity_attributes(self) -> Iterable[str]: def source_path_attributes(self) -> Iterable[str]: # no paths involved here return () - + def __str__(self) -> str: return ",".join(self.names) From 6158ea5ba7e02abfff2b65d378ece0a98982236d Mon Sep 17 00:00:00 2001 From: Johannes Koester Date: Mon, 15 Sep 2025 16:42:00 +0200 Subject: [PATCH 08/19] dbg --- tests/test_plugin.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/test_plugin.py b/tests/test_plugin.py index 416c0fd..56f03f8 100644 --- a/tests/test_plugin.py +++ b/tests/test_plugin.py @@ -14,6 +14,7 @@ class Test(TestSoftwareDeploymentBase): __test__ = True # activate automatic testing + shell_executable = "bash" def get_software_deployment_provider_settings( self, From 583d4c40b6a13e00cac0bd08ff4853bd0c7f2537 Mon Sep 17 00:00:00 2001 From: Johannes Koester Date: Mon, 15 Sep 2025 16:47:23 +0200 Subject: [PATCH 09/19] dbg --- .../__init__.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/snakemake_software_deployment_plugin_envmodules/__init__.py b/src/snakemake_software_deployment_plugin_envmodules/__init__.py index 94e99e5..3d9675a 100644 --- a/src/snakemake_software_deployment_plugin_envmodules/__init__.py +++ b/src/snakemake_software_deployment_plugin_envmodules/__init__.py @@ -36,11 +36,12 @@ def __post_init__(self): @EnvBase.once def check(self) -> None: - if self.run_cmd("type module", stdout=sp.PIPE, stderr=sp.PIPE).returncode != 0: + res = self.run_cmd("module --help && type module", stdout=sp.PIPE, stderr=sp.STDOUT) + if res.returncode != 0: raise WorkflowError( "The module command is not available. " "Please make sure that environment modules are " - "available on your system." + f"available on your system: {res.stdout.decode()}" ) def decorate_shellcmd(self, cmd: str) -> str: From 465da2383f3747fe1567b67cac94d20c7c7b41fd Mon Sep 17 00:00:00 2001 From: Johannes Koester Date: Mon, 15 Sep 2025 17:05:52 +0200 Subject: [PATCH 10/19] dbg --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 44c8699..fca9b92 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -48,7 +48,7 @@ jobs: shell: bash run: | source /etc/profile.d/modules.sh - module --help + command -v module pixi run test -v - name: Run Coverage From f1cf2cb53b7b9081c23421394fca72f8c329e670 Mon Sep 17 00:00:00 2001 From: Johannes Koester Date: Mon, 15 Sep 2025 17:07:39 +0200 Subject: [PATCH 11/19] dbg --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fca9b92..e1ec13d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -45,7 +45,7 @@ jobs: sudo apt-get install -y environment-modules - name: Run pytest - shell: bash + shell: bash -el {0} run: | source /etc/profile.d/modules.sh command -v module From 8695c83b8ce3e82a91e068b1b157214a22bab954 Mon Sep 17 00:00:00 2001 From: Johannes Koester Date: Mon, 15 Sep 2025 17:11:22 +0200 Subject: [PATCH 12/19] dbg --- src/snakemake_software_deployment_plugin_envmodules/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/snakemake_software_deployment_plugin_envmodules/__init__.py b/src/snakemake_software_deployment_plugin_envmodules/__init__.py index 3d9675a..a0cb9a0 100644 --- a/src/snakemake_software_deployment_plugin_envmodules/__init__.py +++ b/src/snakemake_software_deployment_plugin_envmodules/__init__.py @@ -36,7 +36,7 @@ def __post_init__(self): @EnvBase.once def check(self) -> None: - res = self.run_cmd("module --help && type module", stdout=sp.PIPE, stderr=sp.STDOUT) + res = self.run_cmd("echo $PATH && command -v module && module --help && type module", stdout=sp.PIPE, stderr=sp.STDOUT) if res.returncode != 0: raise WorkflowError( "The module command is not available. " From 45b4c0e61c0b7339b273b5ab33cdb8dc0a4f164b Mon Sep 17 00:00:00 2001 From: Johannes Koester Date: Mon, 15 Sep 2025 17:11:43 +0200 Subject: [PATCH 13/19] dbg --- src/snakemake_software_deployment_plugin_envmodules/__init__.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/snakemake_software_deployment_plugin_envmodules/__init__.py b/src/snakemake_software_deployment_plugin_envmodules/__init__.py index a0cb9a0..e642402 100644 --- a/src/snakemake_software_deployment_plugin_envmodules/__init__.py +++ b/src/snakemake_software_deployment_plugin_envmodules/__init__.py @@ -36,6 +36,7 @@ def __post_init__(self): @EnvBase.once def check(self) -> None: + print(self.shell_executable) res = self.run_cmd("echo $PATH && command -v module && module --help && type module", stdout=sp.PIPE, stderr=sp.STDOUT) if res.returncode != 0: raise WorkflowError( From bcbbdaf88abf053158367a6deb889a0259a132dc Mon Sep 17 00:00:00 2001 From: Johannes Koester Date: Tue, 16 Sep 2025 09:06:34 +0200 Subject: [PATCH 14/19] dbg --- .github/workflows/ci.yml | 1 - .../__init__.py | 3 +-- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e1ec13d..6b6d7aa 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -47,7 +47,6 @@ jobs: - name: Run pytest shell: bash -el {0} run: | - source /etc/profile.d/modules.sh command -v module pixi run test -v diff --git a/src/snakemake_software_deployment_plugin_envmodules/__init__.py b/src/snakemake_software_deployment_plugin_envmodules/__init__.py index e642402..3d9675a 100644 --- a/src/snakemake_software_deployment_plugin_envmodules/__init__.py +++ b/src/snakemake_software_deployment_plugin_envmodules/__init__.py @@ -36,8 +36,7 @@ def __post_init__(self): @EnvBase.once def check(self) -> None: - print(self.shell_executable) - res = self.run_cmd("echo $PATH && command -v module && module --help && type module", stdout=sp.PIPE, stderr=sp.STDOUT) + res = self.run_cmd("module --help && type module", stdout=sp.PIPE, stderr=sp.STDOUT) if res.returncode != 0: raise WorkflowError( "The module command is not available. " From 2f110b19acb8f47bbf07759592f30c56d910adc1 Mon Sep 17 00:00:00 2001 From: Johannes Koester Date: Fri, 19 Sep 2025 14:47:42 +0200 Subject: [PATCH 15/19] bump interface --- pyproject.toml | 2 +- tests/test_plugin.py | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 31f2523..3993bd7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -7,7 +7,7 @@ readme = "README.md" requires-python = ">=3.11,<4.0" dependencies = [ "snakemake-interface-common (>=1.17.4,<2.0.0)", - "snakemake-interface-software-deployment-plugins (>=0.7.5,<1.0)", + "snakemake-interface-software-deployment-plugins (>=0.7.6,<1.0)", ] [tool.pixi.pypi-dependencies] diff --git a/tests/test_plugin.py b/tests/test_plugin.py index 56f03f8..416c0fd 100644 --- a/tests/test_plugin.py +++ b/tests/test_plugin.py @@ -14,7 +14,6 @@ class Test(TestSoftwareDeploymentBase): __test__ = True # activate automatic testing - shell_executable = "bash" def get_software_deployment_provider_settings( self, From 29c130bbf005a10f89ff952c38948f28ed393cfb Mon Sep 17 00:00:00 2001 From: Johannes Koester Date: Fri, 19 Sep 2025 15:10:39 +0200 Subject: [PATCH 16/19] dbg --- .../__init__.py | 4 +++- tests/test_plugin.py | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/snakemake_software_deployment_plugin_envmodules/__init__.py b/src/snakemake_software_deployment_plugin_envmodules/__init__.py index 3d9675a..e9b2a0b 100644 --- a/src/snakemake_software_deployment_plugin_envmodules/__init__.py +++ b/src/snakemake_software_deployment_plugin_envmodules/__init__.py @@ -36,7 +36,9 @@ def __post_init__(self): @EnvBase.once def check(self) -> None: - res = self.run_cmd("module --help && type module", stdout=sp.PIPE, stderr=sp.STDOUT) + res = self.run_cmd( + "module --help && type module", stdout=sp.PIPE, stderr=sp.STDOUT + ) if res.returncode != 0: raise WorkflowError( "The module command is not available. " diff --git a/tests/test_plugin.py b/tests/test_plugin.py index 416c0fd..af22d47 100644 --- a/tests/test_plugin.py +++ b/tests/test_plugin.py @@ -14,6 +14,7 @@ class Test(TestSoftwareDeploymentBase): __test__ = True # activate automatic testing + shell_executable = ["bash", "-l", "-c"] def get_software_deployment_provider_settings( self, From 6295b0e1604e66dd7a3723120a67c2f6fbbb70c7 Mon Sep 17 00:00:00 2001 From: Johannes Koester Date: Fri, 19 Sep 2025 15:30:10 +0200 Subject: [PATCH 17/19] bump interface --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 3993bd7..61ff967 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -7,7 +7,7 @@ readme = "README.md" requires-python = ">=3.11,<4.0" dependencies = [ "snakemake-interface-common (>=1.17.4,<2.0.0)", - "snakemake-interface-software-deployment-plugins (>=0.7.6,<1.0)", + "snakemake-interface-software-deployment-plugins (>=0.7.7,<1.0)", ] [tool.pixi.pypi-dependencies] From 2da27f9aa5493acf5f3c0b59c73044ebbe9ad0b2 Mon Sep 17 00:00:00 2001 From: Johannes Koester Date: Fri, 19 Sep 2025 15:36:34 +0200 Subject: [PATCH 18/19] fix --- .../__init__.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/snakemake_software_deployment_plugin_envmodules/__init__.py b/src/snakemake_software_deployment_plugin_envmodules/__init__.py index e9b2a0b..a9ade02 100644 --- a/src/snakemake_software_deployment_plugin_envmodules/__init__.py +++ b/src/snakemake_software_deployment_plugin_envmodules/__init__.py @@ -1,3 +1,4 @@ +import shlex from typing import Iterable import subprocess as sp from snakemake_interface_software_deployment_plugins import ( @@ -37,7 +38,7 @@ def __post_init__(self): @EnvBase.once def check(self) -> None: res = self.run_cmd( - "module --help && type module", stdout=sp.PIPE, stderr=sp.STDOUT + "type module", stdout=sp.PIPE, stderr=sp.STDOUT ) if res.returncode != 0: raise WorkflowError( @@ -51,7 +52,7 @@ def decorate_shellcmd(self, cmd: str) -> str: # Unclear why that happens. # one might have to say 'shopt -s expand_aliases;', but that did not # help either... - return f"module purge && module load {' '.join(self.spec.names)} && {cmd}" + return f"module purge && module load {' '.join(shlex.quote(name) for name in self.spec.names)} && {cmd}" def record_hash(self, hash_object) -> None: # We just hash the names here as the best thing we can do for envmodules From 80786ea371e494f438b2f871def5346b66b19ef4 Mon Sep 17 00:00:00 2001 From: Johannes Koester Date: Fri, 19 Sep 2025 15:38:27 +0200 Subject: [PATCH 19/19] fmt --- .../__init__.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/snakemake_software_deployment_plugin_envmodules/__init__.py b/src/snakemake_software_deployment_plugin_envmodules/__init__.py index a9ade02..2fb266c 100644 --- a/src/snakemake_software_deployment_plugin_envmodules/__init__.py +++ b/src/snakemake_software_deployment_plugin_envmodules/__init__.py @@ -37,9 +37,7 @@ def __post_init__(self): @EnvBase.once def check(self) -> None: - res = self.run_cmd( - "type module", stdout=sp.PIPE, stderr=sp.STDOUT - ) + res = self.run_cmd("type module", stdout=sp.PIPE, stderr=sp.STDOUT) if res.returncode != 0: raise WorkflowError( "The module command is not available. "