Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove params.enable_conda #2131

Merged
merged 9 commits into from
Dec 16, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
### General

- Only check that a pipeline name doesn't contain dashes if the name is provided by prompt of `--name`. Don't check if a template file is used. ([#2123](https://github.com/nf-core/tools/pull/2123))
- Deprecate `--enable_conda` parameter. Use `conda.enable` instead ([#2131](https://github.com/nf-core/tools/pull/2131))

## [v2.7.1 - Mercury Eagle Patch](https://github.com/nf-core/tools/releases/tag/2.7.1) - [2022-12-08]

Expand Down
1 change: 1 addition & 0 deletions nf_core/lint/nextflow_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ def nextflow_config(self):
"params.singleEnd",
"params.igenomesIgnore",
"params.name",
"params.enable_conda",
]

# Remove field that should be ignored according to the linting config
Expand Down
2 changes: 1 addition & 1 deletion nf_core/module-template/modules/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ process {{ tool_name_underscore|upper }} {
// Software MUST be pinned to channel (i.e. "bioconda"), version (i.e. "1.10").
// For Conda, the build (i.e. "h9402c20_2") must be EXCLUDED to support installation on different operating systems.
// TODO nf-core: See section in main README for further information regarding finding and adding container addresses to the section below.
conda (params.enable_conda ? "{{ bioconda if bioconda else 'YOUR-TOOL-HERE' }}" : null)
conda "{{ bioconda if bioconda else 'YOUR-TOOL-HERE' }}"
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'{{ singularity_container if singularity_container else 'https://depot.galaxyproject.org/singularity/YOUR-TOOL-HERE' }}':
'{{ docker_container if docker_container else 'quay.io/biocontainers/YOUR-TOOL-HERE' }}' }"
Expand Down
2 changes: 1 addition & 1 deletion nf_core/pipeline-template/lib/WorkflowMain.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ class WorkflowMain {
NfcoreTemplate.checkConfigProvided(workflow, log)

// Check that conda channels are set-up correctly
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can still use this @mirpedrol

if (params.enable_conda) {
if (workflow.profile.tokenize(',').intersect(['conda', 'mamba']).size() >= 1) {
Utils.checkCondaChannels(log)
}

Expand Down
6 changes: 3 additions & 3 deletions nf_core/pipeline-template/modules.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,17 @@
"nf-core": {
"custom/dumpsoftwareversions": {
"branch": "master",
"git_sha": "5e34754d42cd2d5d248ca8673c0a53cdf5624905",
"git_sha": "c8e35eb2055c099720a75538d1b8adb3fb5a464c",
"installed_by": ["modules"]
},
"fastqc": {
"branch": "master",
"git_sha": "5e34754d42cd2d5d248ca8673c0a53cdf5624905",
"git_sha": "c8e35eb2055c099720a75538d1b8adb3fb5a464c",
"installed_by": ["modules"]
},
"multiqc": {
"branch": "master",
"git_sha": "5e34754d42cd2d5d248ca8673c0a53cdf5624905",
"git_sha": "c8e35eb2055c099720a75538d1b8adb3fb5a464c",
"installed_by": ["modules"]
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ process SAMPLESHEET_CHECK {
tag "$samplesheet"
label 'process_single'

conda (params.enable_conda ? "conda-forge::python=3.8.3" : null)
conda "conda-forge::python=3.8.3"
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://depot.galaxyproject.org/singularity/python:3.8.3' :
'quay.io/biocontainers/python:3.8.3' }"
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

99 changes: 55 additions & 44 deletions ...ne-template/modules/nf-core/custom/dumpsoftwareversions/templates/dumpsoftwareversions.py
100644 → 100755

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

40 changes: 16 additions & 24 deletions nf_core/pipeline-template/modules/nf-core/fastqc/main.nf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion nf_core/pipeline-template/modules/nf-core/multiqc/main.nf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 0 additions & 3 deletions nf_core/pipeline-template/nextflow.config
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ params {
validate_params = true
show_hidden_params = false
schema_ignore_params = 'genomes'
enable_conda = false
{% if nf_core_configs %}

// Config options
Expand Down Expand Up @@ -84,7 +83,6 @@ try {
profiles {
debug { process.beforeScript = 'echo $HOSTNAME' }
conda {
params.enable_conda = true
conda.enabled = true
docker.enabled = false
singularity.enabled = false
Expand All @@ -93,7 +91,6 @@ profiles {
charliecloud.enabled = false
}
mamba {
params.enable_conda = true
conda.enabled = true
conda.useMamba = true
docker.enabled = false
Expand Down
6 changes: 0 additions & 6 deletions nf_core/pipeline-template/nextflow_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -263,12 +263,6 @@
"description": "Show all params when using `--help`",
"hidden": true,
"help_text": "By default, parameters set as _hidden_ in the schema are not shown on the command line when a user runs with `--help`. Specifying this option will tell the pipeline to show all parameters."
},
"enable_conda": {
"type": "boolean",
"description": "Run this workflow with Conda. You can also use '-profile conda' instead of providing this parameter.",
"hidden": true,
"fa_icon": "fas fa-bacon"
}
}
}
Expand Down
12 changes: 12 additions & 0 deletions tests/modules/update.py
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,12 @@ def test_update_only_show_differences(self, mock_prompt):
modules_json = ModulesJson(self.pipeline_dir)
update_obj = ModuleUpdate(self.pipeline_dir, update_all=True, show_diff=True)

# Update modules to a fixed old SHA
update_old = ModuleUpdate(
self.pipeline_dir, update_all=True, show_diff=False, sha="5e34754d42cd2d5d248ca8673c0a53cdf5624905"
)
update_old.update()

tmpdir = tempfile.mkdtemp()
shutil.rmtree(tmpdir)
shutil.copytree(Path(self.pipeline_dir, "modules", NF_CORE_MODULES_NAME), tmpdir)
Expand All @@ -329,6 +335,12 @@ def test_update_only_show_differences_when_patch(self, mock_prompt):
modules_json = ModulesJson(self.pipeline_dir)
update_obj = ModuleUpdate(self.pipeline_dir, update_all=True, show_diff=True)

# Update modules to a fixed old SHA
update_old = ModuleUpdate(
self.pipeline_dir, update_all=True, show_diff=False, sha="5e34754d42cd2d5d248ca8673c0a53cdf5624905"
)
update_old.update()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is your thinking here, that this change will be tested when we look at the modules.json? Should we maybe
explicitly test that the correct linting test fails?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test makes sure that when we want to only show the differences but not update the module, it is not updated. Specially when there is a patch file because there was a bug on that edge case.
Before updating the modules in the template, we had an old version, so these two new lines were not necessary. Now, as we have the latest version, we need to revert to an older SHA, to be able to test the update afterwards.


# Modify fastqc module, it will have a patch which will be applied during update
# We modify fastqc because it's one of the modules that can be updated and there's another one before it (custom/dumpsoftwareversions)
module_path = Path(self.pipeline_dir, "modules", "nf-core", "fastqc")
Expand Down