Skip to content

Commit a39ed59

Browse files
authored
Merge branch 'dev' into vs-code-tests
2 parents 35eb958 + a7351a2 commit a39ed59

File tree

67 files changed

+2211
-737
lines changed

Some content is hidden

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

67 files changed

+2211
-737
lines changed

.github/actions/create-lint-wf/action.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,12 @@ runs:
6565
run: find nf-core-testpipeline -type f -exec sed -i 's/zenodo.XXXXXX/zenodo.123456/g' {} \;
6666
working-directory: create-lint-wf
6767

68+
# Add empty ro-crate file
69+
- name: add empty ro-crate file
70+
shell: bash
71+
run: touch nf-core-testpipeline/ro-crate-metadata.json
72+
working-directory: create-lint-wf
73+
6874
# Run nf-core pipelines linting
6975
- name: nf-core pipelines lint
7076
shell: bash

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,11 @@ jobs:
147147
run: find my-prefix-testpipeline -type f -exec sed -i 's/zenodo.XXXXXX/zenodo.123456/g' {} \;
148148
working-directory: create-test-lint-wf
149149

150+
# Add empty ro-crate file
151+
- name: add empty ro-crate file
152+
run: touch my-prefix-testpipeline/ro-crate-metadata.json
153+
working-directory: create-test-lint-wf
154+
150155
# Run nf-core linting
151156
- name: nf-core pipelines lint
152157
run: nf-core --log-file log.txt --hide-progress pipelines lint --dir my-prefix-testpipeline --fail-warned

.github/workflows/pytest.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ jobs:
132132
133133
- name: Test with pytest
134134
run: |
135-
python3 -m pytest tests/${{matrix.test}} --color=yes --cov --durations=0 && exit_code=0|| exit_code=$?
135+
python3 -m pytest tests/${{matrix.test}} --color=yes --cov --cov-config=.coveragerc --durations=0 && exit_code=0|| exit_code=$?
136136
# don't fail if no tests were collected, e.g. for test_licence.py
137137
if [ "${exit_code}" -eq 5 ]; then
138138
echo "No tests were collected"

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
repos:
22
- repo: https://github.com/astral-sh/ruff-pre-commit
3-
rev: v0.7.4
3+
rev: v0.8.1
44
hooks:
55
- id: ruff # linter
66
args: [--fix, --exit-non-zero-on-fix] # sort imports and fix

CHANGELOG.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,21 +10,30 @@
1010
- fix workflow_dispatch trigger and parse more review comments in awsfulltest ([#3235](https://github.com/nf-core/tools/pull/3235))
1111
- Add resource limits to Gitpod profile([#3255](https://github.com/nf-core/tools/pull/3255))
1212
- Fix a typo ([#3268](https://github.com/nf-core/tools/pull/3268))
13+
- Remove `def` from `nextflow.config` and add `trace_report_suffix` param ([#3296](https://github.com/nf-core/tools/pull/3296))
14+
- Move `includeConfig 'conf/modules.config'` next to `includeConfig 'conf/base.config'` to not overwrite tests profiles configurations ([#3301](https://github.com/nf-core/tools/pull/3301))
15+
- Use `params.monochrome_logs` in the template and update nf-core components ([#3310](https://github.com/nf-core/tools/pull/3310))
16+
- Fix some typos and improve writing in `usage.md` and `CONTRIBUTING.md` ([#3302](https://github.com/nf-core/tools/pull/3302))
17+
- Add `manifest.contributors` to `nextflow.config` ([#3311](https://github.com/nf-core/tools/pull/3311))
1318

1419
### Download
1520

1621
- First steps towards fixing [#3179](https://github.com/nf-core/tools/issues/3179): Modify `prioritize_direct_download()` to retain Seqera Singularity https:// Container URIs and hardcode Seqera Containers into `gather_registries()` ([#3244](https://github.com/nf-core/tools/pull/3244)).
22+
- Further steps towards fixing [#3179](https://github.com/nf-core/tools/issues/3179): Enable limited support for `oras://` container paths (_only absolute URIs, no flexible registries like with Docker_) and prevent unnecessary image downloads for Seqera Container modules with `reconcile_seqera_container_uris()` ([#3293](https://github.com/nf-core/tools/pull/3293)).
23+
- Update dawidd6/action-download-artifact action to v7 ([#3306](https://github.com/nf-core/tools/pull/3306))
1724

1825
### Linting
1926

20-
- General: Run pre-commit when testing linting the template pipeline ([#3280](https://github.com/nf-core/tools/pull/3280))
27+
- allow mixed `str` and `dict` entries in lint config ([#3228](https://github.com/nf-core/tools/pull/3228))
2128

2229
### Modules
2330

2431
- add a panel around diff previews when updating ([#3246](https://github.com/nf-core/tools/pull/3246))
2532

2633
### Subworkflows
2734

35+
- Add `nf-core subworkflows patch` command ([#2861](https://github.com/nf-core/tools/pull/2861))
36+
2837
### General
2938

3039
- Include .nf-core.yml in `nf-core pipelines bump-version` ([#3220](https://github.com/nf-core/tools/pull/3220))
@@ -44,6 +53,9 @@
4453
- Update pre-commit hook astral-sh/ruff-pre-commit to v0.7.4 ([#3282](https://github.com/nf-core/tools/pull/3282))
4554
- Update codecov/codecov-action action to v5 ([#3283](https://github.com/nf-core/tools/pull/3283))
4655
- Update python:3.12-slim Docker digest to 2a6386a ([#3284](https://github.com/nf-core/tools/pull/3284))
56+
- Update pre-commit hook astral-sh/ruff-pre-commit to v0.8.0 ([#3299](https://github.com/nf-core/tools/pull/3299))
57+
- Update gitpod/workspace-base Docker digest to 12853f7 ([#3309](https://github.com/nf-core/tools/pull/3309))
58+
- Run pre-commit when testing linting the template pipeline ([#3280](https://github.com/nf-core/tools/pull/3280))
4759
- build: Setup VS Code tests ([#3292](https://github.com/nf-core/tools/pull/3292))
4860

4961
## [v3.0.2 - Titanium Tapir Patch](https://github.com/nf-core/tools/releases/tag/3.0.2) - [2024-10-11]

nf_core/__main__.py

Lines changed: 79 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
pipelines_launch,
3737
pipelines_lint,
3838
pipelines_list,
39+
pipelines_rocrate,
3940
pipelines_schema_build,
4041
pipelines_schema_docs,
4142
pipelines_schema_lint,
@@ -86,7 +87,7 @@
8687
},
8788
{
8889
"name": "For developers",
89-
"commands": ["create", "lint", "bump-version", "sync", "schema", "create-logo"],
90+
"commands": ["create", "lint", "bump-version", "sync", "schema", "rocrate", "create-logo"],
9091
},
9192
],
9293
"nf-core modules": [
@@ -570,6 +571,44 @@ def command_pipelines_list(ctx, keywords, sort, json, show_archived):
570571
pipelines_list(ctx, keywords, sort, json, show_archived)
571572

572573

574+
# nf-core pipelines rocrate
575+
@pipelines.command("rocrate")
576+
@click.argument(
577+
"pipeline_dir",
578+
type=click.Path(exists=True),
579+
default=Path.cwd(),
580+
required=True,
581+
metavar="<pipeline directory>",
582+
)
583+
@click.option(
584+
"-j",
585+
"--json_path",
586+
default=Path.cwd(),
587+
type=str,
588+
help="Path to save RO Crate metadata json file to",
589+
)
590+
@click.option("-z", "--zip_path", type=str, help="Path to save RO Crate zip file to")
591+
@click.option(
592+
"-pv",
593+
"--pipeline_version",
594+
type=str,
595+
help="Version of pipeline to use for RO Crate",
596+
default="",
597+
)
598+
@click.pass_context
599+
def rocrate(
600+
ctx,
601+
pipeline_dir: str,
602+
json_path: str,
603+
zip_path: str,
604+
pipeline_version: str,
605+
):
606+
"""
607+
Make an Research Object Crate
608+
"""
609+
pipelines_rocrate(ctx, pipeline_dir, json_path, zip_path, pipeline_version)
610+
611+
573612
# nf-core pipelines sync
574613
@pipelines.command("sync")
575614
@click.pass_context
@@ -1024,7 +1063,7 @@ def command_modules_update(
10241063
default=".",
10251064
help=r"Pipeline directory. [dim]\[default: current working directory][/]",
10261065
)
1027-
@click.option("-r", "--remove", is_flag=True, default=False)
1066+
@click.option("-r", "--remove", is_flag=True, default=False, help="Remove an existent patch file and regenerate it.")
10281067
def command_modules_patch(ctx, tool, directory, remove):
10291068
"""
10301069
Create a patch file for minor changes in a module
@@ -1567,6 +1606,43 @@ def command_subworkflows_install(ctx, subworkflow, directory, prompt, force, sha
15671606
subworkflows_install(ctx, subworkflow, directory, prompt, force, sha)
15681607

15691608

1609+
# nf-core subworkflows patch
1610+
@subworkflows.command("patch")
1611+
@click.pass_context
1612+
@click.argument("tool", type=str, required=False, metavar="<tool> or <tool/subtool>")
1613+
@click.option(
1614+
"-d",
1615+
"--dir",
1616+
type=click.Path(exists=True),
1617+
default=".",
1618+
help=r"Pipeline directory. [dim]\[default: current working directory][/]",
1619+
)
1620+
@click.option("-r", "--remove", is_flag=True, default=False, help="Remove an existent patch file and regenerate it.")
1621+
def subworkflows_patch(ctx, tool, dir, remove):
1622+
"""
1623+
Create a patch file for minor changes in a subworkflow
1624+
1625+
Checks if a subworkflow has been modified locally and creates a patch file
1626+
describing how the module has changed from the remote version
1627+
"""
1628+
from nf_core.subworkflows import SubworkflowPatch
1629+
1630+
try:
1631+
subworkflow_patch = SubworkflowPatch(
1632+
dir,
1633+
ctx.obj["modules_repo_url"],
1634+
ctx.obj["modules_repo_branch"],
1635+
ctx.obj["modules_repo_no_pull"],
1636+
)
1637+
if remove:
1638+
subworkflow_patch.remove(tool)
1639+
else:
1640+
subworkflow_patch.patch(tool)
1641+
except (UserWarning, LookupError) as e:
1642+
log.error(e)
1643+
sys.exit(1)
1644+
1645+
15701646
# nf-core subworkflows remove
15711647
@subworkflows.command("remove")
15721648
@click.pass_context
@@ -1721,7 +1797,7 @@ def command_schema_validate(pipeline, params):
17211797
@click.option(
17221798
"--url",
17231799
type=str,
1724-
default="https://nf-co.re/pipeline_schema_builder",
1800+
default="https://oldsite.nf-co.re/pipeline_schema_builder",
17251801
help="Customise the builder URL (for development work)",
17261802
)
17271803
def command_schema_build(directory, no_prompts, web_only, url):

nf_core/commands_pipelines.py

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import os
33
import sys
44
from pathlib import Path
5+
from typing import Optional, Union
56

67
import rich
78

@@ -277,6 +278,33 @@ def pipelines_list(ctx, keywords, sort, json, show_archived):
277278
stdout.print(list_workflows(keywords, sort, json, show_archived))
278279

279280

281+
# nf-core pipelines rocrate
282+
def pipelines_rocrate(
283+
ctx,
284+
pipeline_dir: Union[str, Path],
285+
json_path: Optional[Union[str, Path]],
286+
zip_path: Optional[Union[str, Path]],
287+
pipeline_version: str,
288+
) -> None:
289+
from nf_core.pipelines.rocrate import ROCrate
290+
291+
if json_path is None and zip_path is None:
292+
log.error("Either `--json_path` or `--zip_path` must be specified.")
293+
sys.exit(1)
294+
else:
295+
pipeline_dir = Path(pipeline_dir)
296+
if json_path is not None:
297+
json_path = Path(json_path)
298+
if zip_path is not None:
299+
zip_path = Path(zip_path)
300+
try:
301+
rocrate_obj = ROCrate(pipeline_dir, pipeline_version)
302+
rocrate_obj.create_rocrate(json_path=json_path, zip_path=zip_path)
303+
except (UserWarning, LookupError, FileNotFoundError) as e:
304+
log.error(e)
305+
sys.exit(1)
306+
307+
280308
# nf-core pipelines sync
281309
def pipelines_sync(ctx, directory, from_branch, pull_request, github_repository, username, template_yaml, force_pr):
282310
"""

0 commit comments

Comments
 (0)