snakemake-executor-plugin-slurm 0.5.2__tar.gz → 0.6.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.

Potentially problematic release.


This version of snakemake-executor-plugin-slurm might be problematic. Click here for more details.

@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: snakemake-executor-plugin-slurm
3
- Version: 0.5.2
3
+ Version: 0.6.0
4
4
  Summary: A Snakemake executor plugin for submitting jobs to a SLURM cluster.
5
5
  Home-page: https://github.com/snakemake/snakemake-executor-plugin-slurm
6
6
  License: MIT
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "snakemake-executor-plugin-slurm"
3
- version = "0.5.2"
3
+ version = "0.6.0"
4
4
  description = "A Snakemake executor plugin for submitting jobs to a SLURM cluster."
5
5
  authors = [
6
6
  "Christian Meesters <meesters@uni-mainz.de>",
@@ -6,6 +6,7 @@ __license__ = "MIT"
6
6
  import csv
7
7
  from io import StringIO
8
8
  import os
9
+ import re
9
10
  import subprocess
10
11
  import time
11
12
  from datetime import datetime, timedelta
@@ -143,6 +144,7 @@ class Executor(RemoteExecutor):
143
144
  call += f" --cpus-per-task={get_cpus_per_task(job)}"
144
145
 
145
146
  if job.resources.get("slurm_extra"):
147
+ self.check_slurm_extra(job)
146
148
  call += f" {job.resources.slurm_extra}"
147
149
 
148
150
  exec_job = self.format_job_exec(job)
@@ -488,3 +490,15 @@ class Executor(RemoteExecutor):
488
490
  "'slurm_partition=<your default partition>'."
489
491
  )
490
492
  return ""
493
+
494
+ def check_slurm_extra(self, job):
495
+ jobname = re.compile(r"--job-name[=?|\s+]|-J\s?")
496
+ if re.search(jobname, job.resources.slurm_extra):
497
+ raise WorkflowError(
498
+ "The '--job-name' option is not allowed in the 'slurm_extra' "
499
+ "parameter. The job name is set by snakemake and must not be "
500
+ "overwritten. It is internally used to check the stati of all "
501
+ "submitted jobs by this workflow."
502
+ "Please consult the documentation if you are unsure how to "
503
+ "query the status of your jobs."
504
+ )