Thanks to visit codestin.com
Credit goes to github.com

Skip to content
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 @@ -31,6 +31,7 @@
* Fix overly strict `--max_time` formatting regex in template schema [[#973](https://github.com/nf-core/tools/issues/973)]
* Added `tool_name_underscore` to the module template to allow TOOL_SUBTOOL in `main.nf` [[#1011](https://github.com/nf-core/tools/issues/1011)]
* Convert `d` to `day` in the `cleanParameters` function to make Duration objects like `2d` pass the validation [[#858](https://github.com/nf-core/tools/issues/858)]
* Added nextflow version to quick start section and adjusted `nf-core bump-version` [[#1032](https://github.com/nf-core/tools/issues/1032)]

## [v1.13.3 - Copper Crocodile Resurrection :crocodile:](https://github.com/nf-core/tools/releases/tag/1.13.2) - [2021-03-24]

Expand Down
50 changes: 35 additions & 15 deletions nf_core/bump_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,8 @@ def bump_nextflow_version(pipeline_obj, new_version):
pipeline_obj,
[
(
r"nxf_ver: \[[\'\"]?{}[\'\"]?, ''\]".format(current_version.replace(".", r"\.")),
# example: nxf_ver: ['20.04.0', '']
r"nxf_ver: \[[\'\"]{}[\'\"], [\'\"][\'\"]\]".format(current_version.replace(".", r"\.")),
"nxf_ver: ['{}', '']".format(new_version),
)
],
Expand All @@ -159,7 +160,14 @@ def bump_nextflow_version(pipeline_obj, new_version):
(
r"nextflow-%E2%89%A5{}-brightgreen.svg".format(current_version.replace(".", r"\.")),
"nextflow-%E2%89%A5{}-brightgreen.svg".format(new_version),
)
),
(
# example: 1. Install [`nextflow`](https://nf-co.re/usage/installation) (`>=20.04.0`)
r"1\.\s*Install\s*\[`nextflow`\]\(https://nf-co\.re/usage/installation\)\s*\(`>={}`\)".format(
current_version.replace(".", r"\.")
),
"1. Install [`nextflow`](https://nf-co.re/usage/installation) (`>={}`)".format(new_version),
),
],
)

Expand Down Expand Up @@ -190,24 +198,36 @@ def update_file_version(filename, pipeline_obj, patterns):
replacements = []
for pattern in patterns:

# Check that we have a match
matches_pattern = re.findall("^.*{}.*$".format(pattern[0]), content, re.MULTILINE)
if len(matches_pattern) == 0:
log.error("Could not find version number in {}: '{}'".format(filename, pattern))
continue
found_match = False

# Replace the match
content = re.sub(pattern[0], pattern[1], content)
matches_newstr = re.findall("^.*{}.*$".format(pattern[1]), content, re.MULTILINE)
newcontent = []
for line in content.splitlines():

# Save for logging
replacements.append((matches_pattern, matches_newstr))
# Match the pattern
matches_pattern = re.findall("^.*{}.*$".format(pattern[0]), line)
if matches_pattern:
found_match = True

# Replace the match
newline = re.sub(pattern[0], pattern[1], line)
newcontent.append(newline)

# Save for logging
replacements.append((line, newline))

# No match, keep line as it is
else:
newcontent.append(line)

if found_match:
content = "\n".join(newcontent)
else:
log.error("Could not find version number in {}: '{}'".format(filename, pattern))

log.info("Updated version in '{}'".format(filename))
for replacement in replacements:
for idx, matched in enumerate(replacement[0]):
stderr.print(" [red] - {}".format(matched.strip()), highlight=False)
stderr.print(" [green] + {}".format(replacement[1][idx].strip()), highlight=False)
stderr.print(" [red] - {}".format(replacement[0].strip()), highlight=False)
stderr.print(" [green] + {}".format(replacement[1].strip()), highlight=False)
stderr.print("\n")

with open(fn, "w") as fh:
Expand Down
2 changes: 1 addition & 1 deletion nf_core/pipeline-template/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ The pipeline is built using [Nextflow](https://www.nextflow.io), a workflow tool

## Quick Start

1. Install [`nextflow`](https://nf-co.re/usage/installation)
1. Install [`nextflow`](https://nf-co.re/usage/installation) (`>=21.04.0`)

2. Install any of [`Docker`](https://docs.docker.com/engine/installation/), [`Singularity`](https://www.sylabs.io/guides/3.0/user-guide/), [`Podman`](https://podman.io/), [`Shifter`](https://nersc.gitlab.io/development/shifter/how-to-use/) or [`Charliecloud`](https://hpc.github.io/charliecloud/) for full pipeline reproducibility _(please only use [`Conda`](https://conda.io/miniconda.html) as a last resort; see [docs](https://nf-co.re/usage/configuration#basic-configuration-profiles))_

Expand Down