snakemake-software-deployment-plugin-envmodules 0.1.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.
- snakemake_software_deployment_plugin_envmodules-0.1.0/PKG-INFO +17 -0
- snakemake_software_deployment_plugin_envmodules-0.1.0/README.md +3 -0
- snakemake_software_deployment_plugin_envmodules-0.1.0/pyproject.toml +32 -0
- snakemake_software_deployment_plugin_envmodules-0.1.0/src/snakemake_software_deployment_plugin_envmodules/__init__.py +23 -0
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
Metadata-Version: 2.3
|
|
2
|
+
Name: snakemake-software-deployment-plugin-envmodules
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary:
|
|
5
|
+
Author: Johannes Koester
|
|
6
|
+
Author-email: johannes.koester@uni-due.de
|
|
7
|
+
Requires-Python: >=3.11,<4.0
|
|
8
|
+
Classifier: Programming Language :: Python :: 3
|
|
9
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
10
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
11
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
12
|
+
Requires-Dist: snakemake-interface-software-deployment-plugins (>=0.1.1,<1.0.0)
|
|
13
|
+
Description-Content-Type: text/markdown
|
|
14
|
+
|
|
15
|
+
# snakemake-software-deployment-plugin-envmodules
|
|
16
|
+
|
|
17
|
+
A snakemake software deployment plugin using [environment modules](https://modules.readthedocs.io).
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "snakemake-software-deployment-plugin-envmodules"
|
|
3
|
+
version = "0.1.0"
|
|
4
|
+
description = ""
|
|
5
|
+
readme = "README.md"
|
|
6
|
+
requires-python = ">=3.11,<4.0"
|
|
7
|
+
dependencies = ["snakemake-interface-software-deployment-plugins >=0.1.1,<1.0.0"]
|
|
8
|
+
repository = "https://github.com/your/plugin"
|
|
9
|
+
documentation = "https://snakemake.github.io/snakemake-plugin-catalog/plugins/software-deployment/envmodules.html"
|
|
10
|
+
[[project.authors]]
|
|
11
|
+
name = "Johannes Koester"
|
|
12
|
+
email = "johannes.koester@uni-due.de"
|
|
13
|
+
|
|
14
|
+
[build-system]
|
|
15
|
+
requires = [ "poetry-core>=2.0.0,<3.0.0",]
|
|
16
|
+
build-backend = "poetry.core.masonry.api"
|
|
17
|
+
|
|
18
|
+
[tool.poetry]
|
|
19
|
+
[[tool.poetry.packages]]
|
|
20
|
+
include = "snakemake_software_deployment_plugin_envmodules"
|
|
21
|
+
from = "src"
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
[tool.poetry.group.dev.dependencies]
|
|
25
|
+
coverage = "^7.6.12"
|
|
26
|
+
pytest = "^8.3.5"
|
|
27
|
+
snakemake = "^8.29.0"
|
|
28
|
+
ruff = "^0.9.9"
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
[tool.poetry.dependencies]
|
|
32
|
+
snakemake-interface-software-deployment-plugins = {develop = true}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
from dataclasses import dataclass
|
|
2
|
+
from typing import List
|
|
3
|
+
from snakemake_interface_software_deployment_plugins import EnvBase, EnvSpecBase
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
@dataclass
|
|
7
|
+
class EnvSpec(EnvSpecBase):
|
|
8
|
+
names: List[str]
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class Env(EnvBase):
|
|
12
|
+
def decorate_shellcmd(self, cmd: str) -> str:
|
|
13
|
+
# Decorate given shell command such that it runs within the environment.
|
|
14
|
+
# Unclear why that happens.
|
|
15
|
+
# one might have to say 'shopt -s expand_aliases;', but that did not
|
|
16
|
+
# help either...
|
|
17
|
+
return f"module purge && module load {' '.join(self.spec.names)}; {cmd}"
|
|
18
|
+
|
|
19
|
+
def record_hash(self, hash_object) -> None:
|
|
20
|
+
# We just hash the names here as the best thing we can do for envmodules
|
|
21
|
+
# for now. Ideally, the hash should change upon changes of what is deployed
|
|
22
|
+
# in the env module.
|
|
23
|
+
hash_object.update(",".join(self.spec.names).encode())
|