Skip to content

Commit afbed88

Browse files
authored
Merge pull request #957 from nf-core/dsl2_template
[BOOM] Universal DSL2 pipeline template adoption on nf-core
2 parents 201a249 + 35a8dcd commit afbed88

78 files changed

Lines changed: 3113 additions & 2218 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/create-lint-wf.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ jobs:
3737
- name: nf-core list
3838
run: nf-core --log-file log.txt list
3939

40-
- name: nf-core licences
41-
run: nf-core --log-file log.txt licences nf-core-testpipeline
40+
# - name: nf-core licences
41+
# run: nf-core --log-file log.txt licences nf-core-testpipeline
4242

4343
- name: nf-core sync
4444
run: nf-core --log-file log.txt sync nf-core-testpipeline/
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Create a pipeline and test it
2+
on: [push, pull_request]
3+
4+
# Uncomment if we need an edge release of Nextflow again
5+
# env: NXF_EDGE: 1
6+
7+
jobs:
8+
RunTestWorkflow:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v2
12+
name: Check out source-code repository
13+
14+
- name: Set up Python 3.7
15+
uses: actions/setup-python@v1
16+
with:
17+
python-version: 3.7
18+
19+
- name: Install python dependencies
20+
run: |
21+
python -m pip install --upgrade pip
22+
pip install .
23+
24+
- name: Install Nextflow
25+
env:
26+
CAPSULE_LOG: none
27+
run: |
28+
wget -qO- get.nextflow.io | bash
29+
sudo mv nextflow /usr/local/bin/
30+
31+
- name: Run nf-core/tools
32+
run: |
33+
nf-core --log-file log.txt create -n testpipeline -d "This pipeline is for testing" -a "Testing McTestface"
34+
nextflow run nf-core-testpipeline -profile test,docker
35+
36+
- name: Upload log file artifact
37+
if: ${{ always() }}
38+
uses: actions/upload-artifact@v2
39+
with:
40+
name: nf-core-log-file
41+
path: log.txt

.github/workflows/markdown-lint.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@ jobs:
99

1010
- uses: actions/setup-node@v1
1111
with:
12-
node-version: '10'
12+
node-version: "10"
1313

1414
- name: Install markdownlint
1515
run: npm install -g markdownlint-cli
1616

1717
- name: Run Markdownlint
18-
run: markdownlint ${GITHUB_WORKSPACE} -c ${GITHUB_WORKSPACE}/.github/markdownlint.yml
18+
run: markdownlint .
1919

2020
# If the above check failed, post a comment on the PR explaining the failure
2121
- name: Post PR comment
@@ -32,8 +32,8 @@ jobs:
3232
* On Mac: `brew install markdownlint-cli`
3333
* Everything else: [Install `npm`](https://www.npmjs.com/get-npm) then [install `markdownlint-cli`](https://www.npmjs.com/package/markdownlint-cli) (`npm install -g markdownlint-cli`)
3434
* Fix the markdown errors
35-
* Automatically: `markdownlint . --config .github/markdownlint.yml --fix`
36-
* Manually resolve anything left from `markdownlint . --config .github/markdownlint.yml`
35+
* Automatically: `markdownlint . --fix`
36+
* Manually resolve anything left from `markdownlint .`
3737
3838
Once you push these changes the test should pass, and you can hide this comment :+1:
3939
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# Markdownlint configuration file
22
default: true
33
line-length: false
4+
ul-indent:
5+
indent: 4
46
no-duplicate-header:
57
siblings_only: true
68
no-inline-html:
@@ -10,7 +12,6 @@ no-inline-html:
1012
- kbd
1113
- details
1214
- summary
13-
- kbd
1415
# tools only - the {{ jinja variables }} break URLs and cause this to error
1516
no-bare-urls: false
1617
# tools only - suppresses error messages for usage of $ in main README

CHANGELOG.md

Lines changed: 92 additions & 90 deletions
Large diffs are not rendered by default.

README.md

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,12 @@ A python package with helper tools for the nf-core community.
2525
* [`nf-core bump-version` - Update nf-core pipeline version number](#bumping-a-pipeline-version-number)
2626
* [`nf-core sync` - Synchronise pipeline TEMPLATE branches](#sync-a-pipeline-with-the-template)
2727
* [`nf-core modules` - commands for dealing with DSL2 modules](#modules)
28-
* [`modules list` - List available modules](#list-modules)
29-
* [`modules install` - Install a module from nf-core/modules](#install-a-module-into-a-pipeline)
30-
* [`modules remove` - Remove a module from a pipeline](#remove-a-module-from-a-pipeline)
31-
* [`modules create` - Create a module from the template](#create-a-new-module)
32-
* [`modules create-test-yml` - Create the `test.yml` file for a module](#create-a-module-test-config-file)
33-
* [`modules lint` - Check a module against nf-core guidelines](#check-a-module-against-nf-core-guidelines)
28+
* [`modules list` - List available modules](#list-modules)
29+
* [`modules install` - Install a module from nf-core/modules](#install-a-module-into-a-pipeline)
30+
* [`modules remove` - Remove a module from a pipeline](#remove-a-module-from-a-pipeline)
31+
* [`modules create` - Create a module from the template](#create-a-new-module)
32+
* [`modules create-test-yml` - Create the `test.yml` file for a module](#create-a-module-test-config-file)
33+
* [`modules lint` - Check a module against nf-core guidelines](#check-a-module-against-nf-core-guidelines)
3434
* [Citation](#citation)
3535

3636
The nf-core tools package is written in Python and can be imported and used within other packages.
@@ -327,24 +327,24 @@ Do you want to run this command now? [y/n]:
327327
### Launch tool options
328328

329329
* `-r`, `--revision`
330-
* Specify a pipeline release (or branch / git commit sha) of the project to run
330+
* Specify a pipeline release (or branch / git commit sha) of the project to run
331331
* `-i`, `--id`
332-
* You can use the web GUI for nf-core pipelines by clicking _"Launch"_ on the website. Once filled in you will be given an ID to use with this command which is used to retrieve your inputs.
332+
* You can use the web GUI for nf-core pipelines by clicking _"Launch"_ on the website. Once filled in you will be given an ID to use with this command which is used to retrieve your inputs.
333333
* `-c`, `--command-only`
334-
* If you prefer not to save your inputs in a JSON file and use `-params-file`, this option will specify all entered params directly in the nextflow command.
334+
* If you prefer not to save your inputs in a JSON file and use `-params-file`, this option will specify all entered params directly in the nextflow command.
335335
* `-p`, `--params-in PATH`
336-
* To use values entered in a previous pipeline run, you can supply the `nf-params.json` file previously generated.
337-
* This will overwrite the pipeline schema defaults before the wizard is launched.
336+
* To use values entered in a previous pipeline run, you can supply the `nf-params.json` file previously generated.
337+
* This will overwrite the pipeline schema defaults before the wizard is launched.
338338
* `-o`, `--params-out PATH`
339-
* Path to save parameters JSON file to. (Default: `nf-params.json`)
339+
* Path to save parameters JSON file to. (Default: `nf-params.json`)
340340
* `-a`, `--save-all`
341-
* Without this option the pipeline will ignore any values that match the pipeline schema defaults.
342-
* This option saves _all_ parameters found to the JSON file.
341+
* Without this option the pipeline will ignore any values that match the pipeline schema defaults.
342+
* This option saves _all_ parameters found to the JSON file.
343343
* `-h`, `--show-hidden`
344-
* A pipeline JSON schema can define some parameters as 'hidden' if they are rarely used or for internal pipeline use only.
345-
* This option forces the wizard to show all parameters, including those labelled as 'hidden'.
344+
* A pipeline JSON schema can define some parameters as 'hidden' if they are rarely used or for internal pipeline use only.
345+
* This option forces the wizard to show all parameters, including those labelled as 'hidden'.
346346
* `--url`
347-
* Change the URL used for the graphical interface, useful for development work on the website.
347+
* Change the URL used for the graphical interface, useful for development work on the website.
348348

349349
## Downloading pipelines for offline use
350350

nf_core/bump_version.py

Lines changed: 9 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -34,75 +34,13 @@ def bump_pipeline_version(pipeline_obj, new_version):
3434
log.info("Changing version number from '{}' to '{}'".format(current_version, new_version))
3535

3636
# nextflow.config - workflow manifest version
37-
# nextflow.config - process container manifest version
38-
docker_tag = "dev"
39-
if new_version.replace(".", "").isdigit():
40-
docker_tag = new_version
41-
else:
42-
log.info("New version contains letters. Setting docker tag to 'dev'")
43-
4437
update_file_version(
4538
"nextflow.config",
4639
pipeline_obj,
4740
[
4841
(
4942
r"version\s*=\s*[\'\"]?{}[\'\"]?".format(current_version.replace(".", r"\.")),
5043
"version = '{}'".format(new_version),
51-
),
52-
(
53-
r"container\s*=\s*[\'\"]nfcore/{}:(?:{}|dev)[\'\"]".format(
54-
pipeline_obj.pipeline_name.lower(), current_version.replace(".", r"\.")
55-
),
56-
"container = 'nfcore/{}:{}'".format(pipeline_obj.pipeline_name.lower(), docker_tag),
57-
),
58-
],
59-
)
60-
61-
# .github/workflows/ci.yml - docker build image tag
62-
# .github/workflows/ci.yml - docker tag image
63-
update_file_version(
64-
os.path.join(".github", "workflows", "ci.yml"),
65-
pipeline_obj,
66-
[
67-
(
68-
r"docker build --no-cache . -t nfcore/{name}:(?:{tag}|dev)".format(
69-
name=pipeline_obj.pipeline_name.lower(), tag=current_version.replace(".", r"\.")
70-
),
71-
"docker build --no-cache . -t nfcore/{name}:{tag}".format(
72-
name=pipeline_obj.pipeline_name.lower(), tag=docker_tag
73-
),
74-
),
75-
(
76-
r"docker tag nfcore/{name}:dev nfcore/{name}:(?:{tag}|dev)".format(
77-
name=pipeline_obj.pipeline_name.lower(), tag=current_version.replace(".", r"\.")
78-
),
79-
"docker tag nfcore/{name}:dev nfcore/{name}:{tag}".format(
80-
name=pipeline_obj.pipeline_name.lower(), tag=docker_tag
81-
),
82-
),
83-
],
84-
)
85-
86-
# environment.yml - environment name
87-
update_file_version(
88-
"environment.yml",
89-
pipeline_obj,
90-
[
91-
(
92-
r"name: nf-core-{}-{}".format(pipeline_obj.pipeline_name.lower(), current_version.replace(".", r"\.")),
93-
"name: nf-core-{}-{}".format(pipeline_obj.pipeline_name.lower(), new_version),
94-
)
95-
],
96-
)
97-
98-
# Dockerfile - ENV PATH and RUN conda env create
99-
update_file_version(
100-
"Dockerfile",
101-
pipeline_obj,
102-
[
103-
(
104-
r"nf-core-{}-{}".format(pipeline_obj.pipeline_name.lower(), current_version.replace(".", r"\.")),
105-
"nf-core-{}-{}".format(pipeline_obj.pipeline_name.lower(), new_version),
10644
)
10745
],
10846
)
@@ -132,8 +70,8 @@ def bump_nextflow_version(pipeline_obj, new_version):
13270
pipeline_obj,
13371
[
13472
(
135-
r"nextflowVersion\s*=\s*[\'\"]?>={}[\'\"]?".format(current_version.replace(".", r"\.")),
136-
"nextflowVersion = '>={}'".format(new_version),
73+
r"nextflowVersion\s*=\s*[\'\"]?!>={}[\'\"]?".format(current_version.replace(".", r"\.")),
74+
"nextflowVersion = '!>={}'".format(new_version),
13775
)
13876
],
13977
)
@@ -157,15 +95,17 @@ def bump_nextflow_version(pipeline_obj, new_version):
15795
pipeline_obj,
15896
[
15997
(
160-
r"nextflow-%E2%89%A5{}-brightgreen.svg".format(current_version.replace(".", r"\.")),
161-
"nextflow-%E2%89%A5{}-brightgreen.svg".format(new_version),
98+
r"nextflow%20DSL2-%E2%89%A5{}-23aa62.svg".format(current_version.replace(".", r"\.")),
99+
"nextflow%20DSL2-%E2%89%A5{}-23aa62.svg".format(new_version),
162100
),
163101
(
164-
# example: 1. Install [`nextflow`](https://nf-co.re/usage/installation) (`>=20.04.0`)
165-
r"1\.\s*Install\s*\[`nextflow`\]\(https://nf-co\.re/usage/installation\)\s*\(`>={}`\)".format(
102+
# example: 1. Install [`Nextflow`](https://www.nextflow.io/docs/latest/getstarted.html#installation) (`>=20.04.0`)
103+
r"1\.\s*Install\s*\[`Nextflow`\]\(https://www.nextflow.io/docs/latest/getstarted.html#installation\)\s*\(`>={}`\)".format(
166104
current_version.replace(".", r"\.")
167105
),
168-
"1. Install [`nextflow`](https://nf-co.re/usage/installation) (`>={}`)".format(new_version),
106+
"1. Install [`Nextflow`](https://www.nextflow.io/docs/latest/getstarted.html#installation) (`>={}`)".format(
107+
new_version
108+
),
169109
),
170110
],
171111
)

nf_core/create.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919

2020
class PipelineCreate(object):
21-
"""Creates a nf-core pipeline a la carte from the nf-core best-practise template.
21+
"""Creates a nf-core pipeline a la carte from the nf-core best-practice template.
2222
2323
Args:
2424
name (str): Name for the pipeline.
@@ -89,6 +89,10 @@ def render_template(self):
8989
template_files = list(pathlib.Path(template_dir).glob("**/*"))
9090
template_files += list(pathlib.Path(template_dir).glob("*"))
9191
ignore_strs = [".pyc", "__pycache__", ".pyo", ".pyd", ".DS_Store", ".egg"]
92+
rename_files = {
93+
"workflows/pipeline.nf": f"workflows/{self.short_name}.nf",
94+
"lib/WorkflowPipeline.groovy": f"lib/Workflow{self.short_name[0].upper()}{self.short_name[1:]}.groovy",
95+
}
9296

9397
for template_fn_path_obj in template_files:
9498

@@ -102,6 +106,8 @@ def render_template(self):
102106
# Set up vars and directories
103107
template_fn = os.path.relpath(template_fn_path, template_dir)
104108
output_path = os.path.join(self.outdir, template_fn)
109+
if template_fn in rename_files:
110+
output_path = os.path.join(self.outdir, rename_files[template_fn])
105111
os.makedirs(os.path.dirname(output_path), exist_ok=True)
106112

107113
try:

nf_core/lint/actions_awsfulltest.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ def actions_awsfulltest(self):
1313
The GitHub Actions workflow is called ``awsfulltest.yml``, and it can be found in the ``.github/workflows/`` directory.
1414
1515
.. warning:: This workflow incurs AWS costs, therefore it should only be triggered for pipeline releases:
16-
``workflow_run`` (after the docker hub release workflow) and ``workflow_dispatch``.
16+
``release`` (after the pipeline release) and ``workflow_dispatch``.
1717
1818
.. note:: You can manually trigger the AWS tests by going to the `Actions` tab on the pipeline GitHub repository and selecting the
1919
`nf-core AWS full size tests` workflow on the left.
@@ -23,7 +23,7 @@ def actions_awsfulltest(self):
2323
The ``.github/workflows/awsfulltest.yml`` file is tested for the following:
2424
2525
* Must be turned on ``workflow_dispatch``.
26-
* Must be turned on for ``workflow_run`` with ``workflows: ["nf-core Docker push (release)"]`` and ``types: [completed]``
26+
* Must be turned on for ``release`` with ``types: [published]``
2727
* Should run the profile ``test_full`` that should be edited to provide the links to full-size datasets. If it runs the profile ``test``, a warning is given.
2828
"""
2929
passed = []
@@ -42,9 +42,7 @@ def actions_awsfulltest(self):
4242

4343
# Check that the action is only turned on for published releases
4444
try:
45-
assert "workflow_run" in wf[True]
46-
assert wf[True]["workflow_run"]["workflows"] == ["nf-core Docker push (release)"]
47-
assert wf[True]["workflow_run"]["types"] == ["completed"]
45+
assert wf[True]["release"]["types"] == ["published"]
4846
assert "workflow_dispatch" in wf[True]
4947
except (AssertionError, KeyError, TypeError):
5048
failed.append("`.github/workflows/awsfulltest.yml` is not triggered correctly")

nf_core/lint/conda_dockerfile.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ def conda_dockerfile(self):
4040

4141
# Check if we have both a conda and dockerfile
4242
if self._fp("environment.yml") not in self.files or self._fp("Dockerfile") not in self.files:
43-
return {"ignored": ["No `environment.yml` / `Dockerfile` file found - skipping conda_dockerfile test"]}
43+
return {"warned": ["No `environment.yml` / `Dockerfile` file found - skipping conda_dockerfile test"]}
4444

4545
expected_strings = [
4646
"COPY environment.yml /",

0 commit comments

Comments
 (0)