diff --git a/CHANGELOG.md b/CHANGELOG.md index 61ba31f6f7..7653a8b5bc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,23 @@ # nf-core/tools: Changelog +## v4.1.1dev + +### General + +### Linting + +- remove `ext.use_gpu` as a permitted ext key, superseded by `task.accelerator` ([#4445](https://github.com/nf-core/tools/pull/4445)) + +### Modules + +### Subworkflows + +### Template + +- remove redundant `ext.use_gpu` from the `process_gpu` label, use `accelerator` only ([#4445](https://github.com/nf-core/tools/pull/4445)) + +#### Version updates + ## [v4.1.0 - Marshalled Mamba](https://github.com/nf-core/tools/releases/tag/4.1.0) - [2026-07-29] ### General diff --git a/nf_core/modules/lint/main_nf.py b/nf_core/modules/lint/main_nf.py index 699de45abe..c38b7718ef 100644 --- a/nf_core/modules/lint/main_nf.py +++ b/nf_core/modules/lint/main_nf.py @@ -409,7 +409,7 @@ def check_script_section(self, lines): ) # Validate ext keys - permitted_ext_keys = {"ext.args", "ext.prefix", "ext.prefix2", "ext.use_gpu"} + permitted_ext_keys = {"ext.args", "ext.prefix", "ext.prefix2"} invalid_ext_keys = [ key for key in re.findall(r"\bext\.\w+", script) diff --git a/nf_core/pipeline-template/conf/base.config b/nf_core/pipeline-template/conf/base.config index 4d9519d8fd..691d8b1d77 100644 --- a/nf_core/pipeline-template/conf/base.config +++ b/nf_core/pipeline-template/conf/base.config @@ -63,7 +63,6 @@ process { maxRetries = 2 } withLabel: process_gpu { - ext.use_gpu = { workflow.profile.contains('gpu') } accelerator = { workflow.profile.contains('gpu') ? 1 : null } } } diff --git a/nf_core/pipelines/create/template_features.yml b/nf_core/pipelines/create/template_features.yml index eedd517933..f6b11399e9 100644 --- a/nf_core/pipelines/create/template_features.yml +++ b/nf_core/pipelines/create/template_features.yml @@ -385,7 +385,7 @@ configurations: short_description: "Use GPU" description: "Add GPU support to the pipeline" help_text: | - This will add GPU support to the pipeline. It will add a `use_gpu` parameter to the pipeline. + This will add GPU support to the pipeline via the `process_gpu` label, using the `accelerator` directive. The pipeline will be able to run on GPU-enabled compute environments. nfcore_pipelines: True custom_pipelines: True diff --git a/tests/data/mock_pipeline_containers/conf/base.config b/tests/data/mock_pipeline_containers/conf/base.config index a87a26956d..358d83a1ba 100644 --- a/tests/data/mock_pipeline_containers/conf/base.config +++ b/tests/data/mock_pipeline_containers/conf/base.config @@ -60,7 +60,6 @@ process { maxRetries = 2 } withLabel: process_gpu { - ext.use_gpu = { workflow.profile.contains('gpu') } accelerator = { workflow.profile.contains('gpu') ? 1 : null } } } diff --git a/tests/modules/lint/test_main_nf.py b/tests/modules/lint/test_main_nf.py index 1663a2cc7f..1df6ac9e20 100644 --- a/tests/modules/lint/test_main_nf.py +++ b/tests/modules/lint/test_main_nf.py @@ -1250,7 +1250,6 @@ def args2 = task.ext.args2 ?: '' def args3 = task.ext.args3 ?: '' def prefix = task.ext.prefix ?: "${meta.id}" def prefix2 = task.ext.prefix2 ?: '' - def use_gpu = task.ext.use_gpu ? '--gpu' : '' """ ], ) @@ -1268,6 +1267,7 @@ def suffix = task.ext.suffix ?: '.bam' def prefix1 = task.ext.prefix1 ?: '' def prefix3 = task.ext.prefix3 ?: '' def prefix22 = task.ext.prefix22 ?: '' + def use_gpu = task.ext.use_gpu ? '--gpu' : '' """ ], ) @@ -1278,6 +1278,7 @@ def prefix22 = task.ext.prefix22 ?: '' assert "ext.prefix1" in mock_lint.failed[0][2] assert "ext.prefix3" in mock_lint.failed[0][2] assert "ext.prefix22" in mock_lint.failed[0][2] + assert "ext.use_gpu" in mock_lint.failed[0][2] # ext.argsN where N >= 2 should be valid mock_lint.passed, mock_lint.failed = [], []