diff --git a/snakemake_executor_plugin_slurm_jobstep/__init__.py b/snakemake_executor_plugin_slurm_jobstep/__init__.py index 80d440c..2fecb8e 100644 --- a/snakemake_executor_plugin_slurm_jobstep/__init__.py +++ b/snakemake_executor_plugin_slurm_jobstep/__init__.py @@ -15,7 +15,6 @@ ExecutorJobInterface, ) from snakemake_interface_executor_plugins.settings import ExecMode -from snakemake_interface_common.exceptions import WorkflowError # Required: @@ -54,17 +53,8 @@ def __init__( pass_envvar_declarations_to_cmd=False, ) # These environment variables are set by SLURM. - - self.mem_per_node = os.getenv("SLURM_MEM_PER_NODE") - self.cpus_on_node = os.getenv("SLURM_CPUS_ON_NODE") + # only needed for commented out jobstep handling below self.jobid = os.getenv("SLURM_JOB_ID") - if self.jobid is None: - raise WorkflowError( - "Environment variable SLURM_JOB_ID is not set, which is unsupported. " - "Note that the slurm-jobstep executor plugin can only be used inside " - "of SLURM jobs and is meant to be triggered only by the slurm executor " - "plugin." - ) def run_job(self, job: ExecutorJobInterface): # Implement here how to run a job. diff --git a/tests/tests.py b/tests/tests.py index 8155b6d..2bee201 100644 --- a/tests/tests.py +++ b/tests/tests.py @@ -1,15 +1,8 @@ -import os from typing import Optional import snakemake.common.tests from snakemake_interface_executor_plugins import ExecutorSettingsBase -# fake slurm job environment -os.environ["SLURM_JOB_ID"] = "100" -os.environ["SLURM_MEM_PER_NODE"] = "100" -os.environ["SLURM_CPUS_ON_NODE"] = "1" - - class TestWorkflowsBase(snakemake.common.tests.TestWorkflowsBase): __test__ = True