Skip to content

Commit 8baba42

Browse files
authored
Merge branch 'main' into docs/review-new-docs
2 parents 9361226 + 6c8499a commit 8baba42

File tree

5 files changed

+242
-18
lines changed

5 files changed

+242
-18
lines changed

.github/workflows/announce-release.yml

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,18 +16,23 @@ jobs:
1616
runs-on: ubuntu-latest
1717
steps:
1818
- name: Post to Mastodon
19-
uses: snakemake/mastodon-release-post-action@v1
19+
uses: snakemake/mastodon-release-post-action@v1.2.3
2020
with:
21+
access-token: ${{ secrets.MASTODONBOT }}
22+
pr-title: ${{ github.event.head_commit.message }}
2123
message: |
2224
Beep, Beep - I am your friendly #Snakemake release announcement bot.
2325
24-
There is a new release of the Snakemake executor for #SLURM on #HPC systems. Its version is {{ version }}!
26+
There is a new release of the Snakemake executor for #SLURM on #HPC systems. Its version now is {{ version }}!
2527
26-
See {{ changelog }} for details.
28+
Give us some time, and you will automatically find the plugin on #Bioconda and #Pypi.
2729
28-
Give us some time and you will automatically find the plugin on #Bioconda and #Pypi.
30+
If you want to discuss the release, you will find the maintainers here on Mastodon!
31+
@rupdecat and @johanneskoester@fosstodon.org
2932
30-
If you want to discuss the release you will find the maintainers here on Mastodon!
31-
@rupdecat and @johanneskoester
33+
If you discover any issues, please report them on {{ issue_url }}.
34+
35+
See {{ changelog }} for details. Here is the header of the changelog:
36+
37+
${{ steps.extract-release-notes.outputs.release_notes }}
3238
33-
If you find any issues, please report them on {{ issue_url }}

CHANGELOG.md

Lines changed: 164 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,169 @@
11
# Changelog
22

3+
## [1.3.6](https://github.com/snakemake/snakemake-executor-plugin-slurm/compare/v1.3.5...v1.3.6) (2025-05-18)
4+
5+
6+
### Bug Fixes
7+
8+
* release notes to action script ([#310](https://github.com/snakemake/snakemake-executor-plugin-slurm/issues/310)) ([c5a3d6e](https://github.com/snakemake/snakemake-executor-plugin-slurm/commit/c5a3d6ebcc8493731b4e3a048a603eb110847de4))
9+
10+
## [1.3.5](https://github.com/snakemake/snakemake-executor-plugin-slurm/compare/v1.3.4...v1.3.5) (2025-05-17)
11+
12+
13+
### Bug Fixes
14+
15+
* full release notes ([#308](https://github.com/snakemake/snakemake-executor-plugin-slurm/issues/308)) ([736b452](https://github.com/snakemake/snakemake-executor-plugin-slurm/commit/736b4528d95d5473534522eecbea64f71023885a))
16+
17+
## [1.3.4](https://github.com/snakemake/snakemake-executor-plugin-slurm/compare/v1.3.3...v1.3.4) (2025-05-17)
18+
19+
20+
### Bug Fixes
21+
22+
* full release notes ([#306](https://github.com/snakemake/snakemake-executor-plugin-slurm/issues/306)) ([f4a8277](https://github.com/snakemake/snakemake-executor-plugin-slurm/commit/f4a827747b3e86590746907d16151605f705455a))
23+
24+
## [1.3.3](https://github.com/snakemake/snakemake-executor-plugin-slurm/compare/v1.3.2...v1.3.3) (2025-05-17)
25+
26+
27+
### Bug Fixes
28+
29+
* full release notes ([#304](https://github.com/snakemake/snakemake-executor-plugin-slurm/issues/304)) ([0465f85](https://github.com/snakemake/snakemake-executor-plugin-slurm/commit/0465f85c5d0fd34fce6ef650220890533059a2dd))
30+
31+
## [1.3.2](https://github.com/snakemake/snakemake-executor-plugin-slurm/compare/v1.3.1...v1.3.2) (2025-05-17)
32+
33+
34+
### Bug Fixes
35+
36+
* full release notes ([#302](https://github.com/snakemake/snakemake-executor-plugin-slurm/issues/302)) ([7fd32f0](https://github.com/snakemake/snakemake-executor-plugin-slurm/commit/7fd32f0f4a22b5f54fedaab0282242244fb35d9a))
37+
38+
## [1.3.1](https://github.com/snakemake/snakemake-executor-plugin-slurm/compare/v1.3.0...v1.3.1) (2025-05-17)
39+
40+
41+
### Bug Fixes
42+
43+
* full release notes ([#300](https://github.com/snakemake/snakemake-executor-plugin-slurm/issues/300)) ([4faed8d](https://github.com/snakemake/snakemake-executor-plugin-slurm/commit/4faed8d3729934174281bc08baa33bd0c0b4537f))
44+
45+
## [1.3.0](https://github.com/snakemake/snakemake-executor-plugin-slurm/compare/v1.2.17...v1.3.0) (2025-05-17)
46+
47+
48+
### Features
49+
50+
* attempt to gain full release notes posted on mastodon ([#298](https://github.com/snakemake/snakemake-executor-plugin-slurm/issues/298)) ([b207279](https://github.com/snakemake/snakemake-executor-plugin-slurm/commit/b2072798961723ded86ac002b5bc606bd114a780))
51+
52+
## [1.2.17](https://github.com/snakemake/snakemake-executor-plugin-slurm/compare/v1.2.16...v1.2.17) (2025-05-16)
53+
54+
55+
### Bug Fixes
56+
57+
* tolerant argparsing for mastodon announcements ([#296](https://github.com/snakemake/snakemake-executor-plugin-slurm/issues/296)) ([3b4fbe0](https://github.com/snakemake/snakemake-executor-plugin-slurm/commit/3b4fbe0db352bd56af5df8bb669879dbd28b7264))
58+
59+
## [1.2.16](https://github.com/snakemake/snakemake-executor-plugin-slurm/compare/v1.2.15...v1.2.16) (2025-05-16)
60+
61+
62+
### Bug Fixes
63+
64+
* announce action ([#294](https://github.com/snakemake/snakemake-executor-plugin-slurm/issues/294)) ([7906f0c](https://github.com/snakemake/snakemake-executor-plugin-slurm/commit/7906f0c07de6033f0d95e795efbfacaa131de793))
65+
66+
## [1.2.15](https://github.com/snakemake/snakemake-executor-plugin-slurm/compare/v1.2.14...v1.2.15) (2025-05-16)
67+
68+
69+
### Bug Fixes
70+
71+
* announce action ([#291](https://github.com/snakemake/snakemake-executor-plugin-slurm/issues/291)) ([6dd4053](https://github.com/snakemake/snakemake-executor-plugin-slurm/commit/6dd4053ce7e2cb1f12f289b5fbfe83a1b50832d9))
72+
73+
## [1.2.14](https://github.com/snakemake/snakemake-executor-plugin-slurm/compare/v1.2.13...v1.2.14) (2025-05-16)
74+
75+
76+
### Bug Fixes
77+
78+
* new version announcement bot ([#289](https://github.com/snakemake/snakemake-executor-plugin-slurm/issues/289)) ([732e3d4](https://github.com/snakemake/snakemake-executor-plugin-slurm/commit/732e3d46e69b198a97785fb04add197c2afde1ec))
79+
80+
## [1.2.13](https://github.com/snakemake/snakemake-executor-plugin-slurm/compare/v1.2.12...v1.2.13) (2025-05-16)
81+
82+
83+
### Bug Fixes
84+
85+
* pr title ([#287](https://github.com/snakemake/snakemake-executor-plugin-slurm/issues/287)) ([a3a548c](https://github.com/snakemake/snakemake-executor-plugin-slurm/commit/a3a548c85229f7b301c6f9597e25b78d1abd77e4))
86+
87+
## [1.2.12](https://github.com/snakemake/snakemake-executor-plugin-slurm/compare/v1.2.11...v1.2.12) (2025-05-16)
88+
89+
90+
### Bug Fixes
91+
92+
* pr title ([#283](https://github.com/snakemake/snakemake-executor-plugin-slurm/issues/283)) ([848e21f](https://github.com/snakemake/snakemake-executor-plugin-slurm/commit/848e21f9a9fd8879925811f9079805c7afdac79b))
93+
94+
## [1.2.11](https://github.com/snakemake/snakemake-executor-plugin-slurm/compare/v1.2.10...v1.2.11) (2025-05-14)
95+
96+
97+
### Bug Fixes
98+
99+
* pr title from tag ([#281](https://github.com/snakemake/snakemake-executor-plugin-slurm/issues/281)) ([eae7276](https://github.com/snakemake/snakemake-executor-plugin-slurm/commit/eae727630555a8f99f03f0904dd471035e726206))
100+
101+
## [1.2.10](https://github.com/snakemake/snakemake-executor-plugin-slurm/compare/v1.2.9...v1.2.10) (2025-05-13)
102+
103+
104+
### Bug Fixes
105+
106+
* pr title ([#279](https://github.com/snakemake/snakemake-executor-plugin-slurm/issues/279)) ([8465733](https://github.com/snakemake/snakemake-executor-plugin-slurm/commit/8465733f9d52452ac5d229f147b60645b46f410f))
107+
108+
## [1.2.9](https://github.com/snakemake/snakemake-executor-plugin-slurm/compare/v1.2.8...v1.2.9) (2025-05-13)
109+
110+
111+
### Bug Fixes
112+
113+
* added pr title ([#276](https://github.com/snakemake/snakemake-executor-plugin-slurm/issues/276)) ([efbd5a9](https://github.com/snakemake/snakemake-executor-plugin-slurm/commit/efbd5a9982434467d14c1501617de94316da17a0))
114+
* pr title ([#278](https://github.com/snakemake/snakemake-executor-plugin-slurm/issues/278)) ([3e8f325](https://github.com/snakemake/snakemake-executor-plugin-slurm/commit/3e8f325ea823e85aefcefe57dc3064218f7c400c))
115+
116+
## [1.2.8](https://github.com/snakemake/snakemake-executor-plugin-slurm/compare/v1.2.7...v1.2.8) (2025-05-13)
117+
118+
119+
### Bug Fixes
120+
121+
* action version ([#274](https://github.com/snakemake/snakemake-executor-plugin-slurm/issues/274)) ([87cccbb](https://github.com/snakemake/snakemake-executor-plugin-slurm/commit/87cccbbce054b97781700d865b22c37f7619ecb4))
122+
123+
## [1.2.7](https://github.com/snakemake/snakemake-executor-plugin-slurm/compare/v1.2.6...v1.2.7) (2025-05-13)
124+
125+
126+
### Bug Fixes
127+
128+
* using, hopefully fixed, action script ([#272](https://github.com/snakemake/snakemake-executor-plugin-slurm/issues/272)) ([81bcf0e](https://github.com/snakemake/snakemake-executor-plugin-slurm/commit/81bcf0ec57e00285b8514c634ea1994deea650b5))
129+
130+
## [1.2.6](https://github.com/snakemake/snakemake-executor-plugin-slurm/compare/v1.2.5...v1.2.6) (2025-05-13)
131+
132+
133+
### Bug Fixes
134+
135+
* yet another attempt ([#270](https://github.com/snakemake/snakemake-executor-plugin-slurm/issues/270)) ([37e042e](https://github.com/snakemake/snakemake-executor-plugin-slurm/commit/37e042e7e55bacd3dc22c3a24d1608700d4e5771))
136+
137+
## [1.2.5](https://github.com/snakemake/snakemake-executor-plugin-slurm/compare/v1.2.4...v1.2.5) (2025-05-12)
138+
139+
140+
### Bug Fixes
141+
142+
* mastodon secret used workflow, not action ([#267](https://github.com/snakemake/snakemake-executor-plugin-slurm/issues/267)) ([7e4f7c9](https://github.com/snakemake/snakemake-executor-plugin-slurm/commit/7e4f7c9d4966bc711e2a1cb66ae7a86ea82e1158))
143+
* secret in workflow ([#269](https://github.com/snakemake/snakemake-executor-plugin-slurm/issues/269)) ([d2bd734](https://github.com/snakemake/snakemake-executor-plugin-slurm/commit/d2bd734e858b2211ea08c3e6d149e6b2f25d0192))
144+
145+
## [1.2.4](https://github.com/snakemake/snakemake-executor-plugin-slurm/compare/v1.2.3...v1.2.4) (2025-05-11)
146+
147+
148+
### Bug Fixes
149+
150+
* update mastodon action ([#265](https://github.com/snakemake/snakemake-executor-plugin-slurm/issues/265)) ([23ba7ce](https://github.com/snakemake/snakemake-executor-plugin-slurm/commit/23ba7ce9073e79966102878feac617ac503d42b1))
151+
152+
## [1.2.3](https://github.com/snakemake/snakemake-executor-plugin-slurm/compare/v1.2.2...v1.2.3) (2025-05-11)
153+
154+
155+
### Bug Fixes
156+
157+
* using latest fix for the announcement action ([#263](https://github.com/snakemake/snakemake-executor-plugin-slurm/issues/263)) ([efd1f88](https://github.com/snakemake/snakemake-executor-plugin-slurm/commit/efd1f88e8426cfd6071819e19f18826ce215a81a))
158+
159+
## [1.2.2](https://github.com/snakemake/snakemake-executor-plugin-slurm/compare/v1.2.1...v1.2.2) (2025-05-08)
160+
161+
162+
### Bug Fixes
163+
164+
* checking for double nested strings in gres and gpu settings ([#251](https://github.com/snakemake/snakemake-executor-plugin-slurm/issues/251)) ([a7eac3a](https://github.com/snakemake/snakemake-executor-plugin-slurm/commit/a7eac3a0aeff74a83ab06578c0528c7473c92afa))
165+
* Increase account charecter limit ([#260](https://github.com/snakemake/snakemake-executor-plugin-slurm/issues/260)) ([1264de3](https://github.com/snakemake/snakemake-executor-plugin-slurm/commit/1264de3123ac638132ba76ffbf5187ff500a9a9b))
166+
3167
## [1.2.1](https://github.com/snakemake/snakemake-executor-plugin-slurm/compare/v1.2.0...v1.2.1) (2025-04-11)
4168

5169

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "snakemake-executor-plugin-slurm"
3-
version = "1.2.1"
3+
version = "1.3.6"
44
description = "A Snakemake executor plugin for submitting jobs to a SLURM cluster."
55
authors = [
66
"Christian Meesters <meesters@uni-mainz.de>",
@@ -25,7 +25,7 @@ black = "^23.7.0"
2525
flake8 = "^6.1.0"
2626
coverage = "^7.3.1"
2727
pytest = "^8.3.5"
28-
snakemake = "^9.1.1"
28+
snakemake = "^9.4.0"
2929

3030
[tool.coverage.run]
3131
omit = [".*", "*/site-packages/*", "Snakefile"]

snakemake_executor_plugin_slurm/utils.py

Lines changed: 28 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,9 @@ def set_gres_string(job: JobExecutorInterface) -> str:
5858
gres_re = re.compile(r"^[a-zA-Z0-9_]+(:[a-zA-Z0-9_]+)?:\d+$")
5959
# gpu model arguments can be of type "string"
6060
gpu_model_re = re.compile(r"^[a-zA-Z0-9_]+$")
61+
# any arguments should not start and end with ticks or
62+
# quotation marks:
63+
string_check = re.compile(r"^[^'\"].*[^'\"]$")
6164
# The Snakemake resources can be only be of type "int",
6265
# hence no further regex is needed.
6366

@@ -81,20 +84,36 @@ def set_gres_string(job: JobExecutorInterface) -> str:
8184
# Validate GRES format (e.g., "gpu:1", "gpu:tesla:2")
8285
gres = job.resources.gres
8386
if not gres_re.match(gres):
84-
raise WorkflowError(
85-
f"Invalid GRES format: {gres}. Expected format: "
86-
"'<name>:<number>' or '<name>:<type>:<number>' "
87-
"(e.g., 'gpu:1' or 'gpu:tesla:2')"
88-
)
87+
if not string_check.match(gres):
88+
raise WorkflowError(
89+
"GRES format should not be a nested string (start "
90+
"and end with ticks or quotation marks). "
91+
"Expected format: "
92+
"'<name>:<number>' or '<name>:<type>:<number>' "
93+
"(e.g., 'gpu:1' or 'gpu:tesla:2')"
94+
)
95+
else:
96+
raise WorkflowError(
97+
f"Invalid GRES format: {gres}. Expected format: "
98+
"'<name>:<number>' or '<name>:<type>:<number>' "
99+
"(e.g., 'gpu:1' or 'gpu:tesla:2')"
100+
)
89101
return f" --gres={job.resources.gres}"
90102

91103
if gpu_model and gpu_string:
92104
# validate GPU model format
93105
if not gpu_model_re.match(gpu_model):
94-
raise WorkflowError(
95-
f"Invalid GPU model format: {gpu_model}."
96-
" Expected format: '<name>' (e.g., 'tesla')"
97-
)
106+
if not string_check.match(gpu_model):
107+
raise WorkflowError(
108+
"GPU model format should not be a nested string (start "
109+
"and end with ticks or quotation marks). "
110+
"Expected format: '<name>' (e.g., 'tesla')"
111+
)
112+
else:
113+
raise WorkflowError(
114+
f"Invalid GPU model format: {gpu_model}."
115+
" Expected format: '<name>' (e.g., 'tesla')"
116+
)
98117
return f" --gpus={gpu_model}:{gpu_string}"
99118
elif gpu_model and not gpu_string:
100119
raise WorkflowError("GPU model is set, but no GPU number is given")

tests/tests.py

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,42 @@ def test_both_gres_and_gpu_set(self, mock_job):
215215
):
216216
set_gres_string(job)
217217

218+
def test_nested_string_raise(self, mock_job):
219+
"""Test error case when gres is a nested string."""
220+
job = mock_job(gres="'gpu:1'")
221+
# Patch subprocess.Popen to simulate job submission
222+
with patch("subprocess.Popen") as mock_popen:
223+
# Configure the mock to simulate successful submission
224+
process_mock = MagicMock()
225+
process_mock.communicate.return_value = ("123", "")
226+
process_mock.returncode = 0
227+
mock_popen.return_value = process_mock
228+
229+
# Ensure the error is raised when both GRES and GPU are set
230+
with pytest.raises(
231+
WorkflowError,
232+
match="GRES format should not be a nested string",
233+
):
234+
set_gres_string(job)
235+
236+
def test_gpu_model_nested_string_raise(self, mock_job):
237+
"""Test error case when gpu_model is a nested string."""
238+
job = mock_job(gpu_model="'tesla'", gpu="2")
239+
# Patch subprocess.Popen to simulate job submission
240+
with patch("subprocess.Popen") as mock_popen:
241+
# Configure the mock to simulate successful submission
242+
process_mock = MagicMock()
243+
process_mock.communicate.return_value = ("123", "")
244+
process_mock.returncode = 0
245+
mock_popen.return_value = process_mock
246+
247+
# Ensure the error is raised when both GRES and GPU are set
248+
with pytest.raises(
249+
WorkflowError,
250+
match="GPU model format should not be a nested string",
251+
):
252+
set_gres_string(job)
253+
218254

219255
class TestSLURMResources(TestWorkflows):
220256
"""

0 commit comments

Comments
 (0)