snakemake-executor-plugin-slurm 1.2.1__py3-none-any.whl → 1.2.3__py3-none-any.whl

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.

@@ -653,7 +653,7 @@ We leave it to SLURM to resume your job(s)"""
653
653
  """
654
654
  tests whether the given account is registered, raises an error, if not
655
655
  """
656
- cmd = "sshare -U --format Account --noheader"
656
+ cmd = "sshare -U --format Account%256 --noheader"
657
657
  try:
658
658
  accounts = subprocess.check_output(
659
659
  cmd, shell=True, text=True, stderr=subprocess.PIPE
@@ -58,6 +58,9 @@ def set_gres_string(job: JobExecutorInterface) -> str:
58
58
  gres_re = re.compile(r"^[a-zA-Z0-9_]+(:[a-zA-Z0-9_]+)?:\d+$")
59
59
  # gpu model arguments can be of type "string"
60
60
  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"^[^'\"].*[^'\"]$")
61
64
  # The Snakemake resources can be only be of type "int",
62
65
  # hence no further regex is needed.
63
66
 
@@ -81,20 +84,36 @@ def set_gres_string(job: JobExecutorInterface) -> str:
81
84
  # Validate GRES format (e.g., "gpu:1", "gpu:tesla:2")
82
85
  gres = job.resources.gres
83
86
  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
+ )
89
101
  return f" --gres={job.resources.gres}"
90
102
 
91
103
  if gpu_model and gpu_string:
92
104
  # validate GPU model format
93
105
  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
+ )
98
117
  return f" --gpus={gpu_model}:{gpu_string}"
99
118
  elif gpu_model and not gpu_string:
100
119
  raise WorkflowError("GPU model is set, but no GPU number is given")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: snakemake-executor-plugin-slurm
3
- Version: 1.2.1
3
+ Version: 1.2.3
4
4
  Summary: A Snakemake executor plugin for submitting jobs to a SLURM cluster.
5
5
  License: MIT
6
6
  Keywords: snakemake,plugin,executor,cluster,slurm
@@ -0,0 +1,7 @@
1
+ snakemake_executor_plugin_slurm/__init__.py,sha256=M90YYpeg4KPj_ebf7uR6JvBiRPwmYtABr6FoUChfswM,31476
2
+ snakemake_executor_plugin_slurm/submit_string.py,sha256=sXzMm5SVNQ4upIOcsIZjUqj7khnG-lieo5yJSSus5sc,2483
3
+ snakemake_executor_plugin_slurm/utils.py,sha256=7XVXtzu7bg_89wWZisW-Zk7TNQyEgK4v_y4Y3F9uOwc,4491
4
+ snakemake_executor_plugin_slurm-1.2.3.dist-info/LICENSE,sha256=YVc4xTLWMqGfFL36120k7rzXtsT6e4RkJsh68VVn12s,1076
5
+ snakemake_executor_plugin_slurm-1.2.3.dist-info/METADATA,sha256=RzbmGjPq104voS-X1drzNBAfsUgcNaNcqZ-T0zSmneQ,1360
6
+ snakemake_executor_plugin_slurm-1.2.3.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
7
+ snakemake_executor_plugin_slurm-1.2.3.dist-info/RECORD,,
@@ -1,4 +1,4 @@
1
1
  Wheel-Version: 1.0
2
- Generator: poetry-core 2.1.2
2
+ Generator: poetry-core 2.1.3
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
@@ -1,7 +0,0 @@
1
- snakemake_executor_plugin_slurm/__init__.py,sha256=QFAmMAvEkBg6BuEtZIFFrh8IY0C0lxZksEd_WwiCyCU,31472
2
- snakemake_executor_plugin_slurm/submit_string.py,sha256=sXzMm5SVNQ4upIOcsIZjUqj7khnG-lieo5yJSSus5sc,2483
3
- snakemake_executor_plugin_slurm/utils.py,sha256=ZzXiXFDVLs15PLJnDP0eq98fNCtzlLbhtT03ec8Ou34,3578
4
- snakemake_executor_plugin_slurm-1.2.1.dist-info/LICENSE,sha256=YVc4xTLWMqGfFL36120k7rzXtsT6e4RkJsh68VVn12s,1076
5
- snakemake_executor_plugin_slurm-1.2.1.dist-info/METADATA,sha256=3l9RutnMcL44MmGTqKEOzfAkSMD8EJwyvRO3yYiGtPc,1360
6
- snakemake_executor_plugin_slurm-1.2.1.dist-info/WHEEL,sha256=fGIA9gx4Qxk2KDKeNJCbOEwSrmLtjWCwzBz351GyrPQ,88
7
- snakemake_executor_plugin_slurm-1.2.1.dist-info/RECORD,,