Skip to content

Commit

Permalink
Merge branch 'dev' into renovate/textual-dev-1.x
Browse files Browse the repository at this point in the history
  • Loading branch information
mirpedrol authored Dec 9, 2024
2 parents c5ffcf8 + 99dba72 commit 4ab2637
Show file tree
Hide file tree
Showing 70 changed files with 776 additions and 382 deletions.
1 change: 0 additions & 1 deletion .github/actions/create-lint-wf/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ runs:
cd create-lint-wf
export NXF_WORK=$(pwd)
# Set up Nextflow
- name: Install Nextflow
uses: nf-core/setup-nextflow@v2
with:
Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/create-lint-wf.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,12 @@ concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

env:
NXF_ANSI_LOG: false

jobs:
MakeTestWorkflow:
runs-on: ${{ github.event.inputs.runners || github.run_number > 1 && 'ubuntu-latest' || 'self-hosted' }}
env:
NXF_ANSI_LOG: false

strategy:
matrix:
NXF_VER:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/create-test-lint-wf-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ jobs:
needs: prepare-matrix
env:
NXF_ANSI_LOG: false

strategy:
matrix:
TEMPLATE: ${{ fromJson(needs.prepare-matrix.outputs.all_features) }}
Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/create-test-wf.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,13 @@ concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

env:
NXF_ANSI_LOG: false

jobs:
RunTestWorkflow:
# use the runner given by the input if it is dispatched manually, run on github if it is a rerun or on self-hosted by default
runs-on: ${{ github.event.inputs.runners || github.run_number > 1 && 'ubuntu-latest' || 'self-hosted' }}
env:
NXF_ANSI_LOG: false

strategy:
matrix:
NXF_VER:
Expand Down
9 changes: 1 addition & 8 deletions .gitpod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,4 @@ tasks:
vscode:
extensions:
- esbenp.prettier-vscode # Markdown/CommonMark linting and style checking for Visual Studio Code
- EditorConfig.EditorConfig # override user/workspace settings with settings found in .editorconfig files
- Gruntfuggly.todo-tree # Display TODO and FIXME in a tree view in the activity bar
- mechatroner.rainbow-csv # Highlight columns in csv files in different colors
- nextflow.nextflow # Nextflow syntax highlighting
- oderwat.indent-rainbow # Highlight indentation level
- streetsidesoftware.code-spell-checker # Spelling checker for source code
- charliermarsh.ruff # Code linter Ruff
- nf-core.nf-core-extensionpack # https://github.com/nf-core/vscode-extensionpack
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.8.1
rev: v0.8.2
hooks:
- id: ruff # linter
args: [--fix, --exit-non-zero-on-fix] # sort imports and fix
Expand Down
9 changes: 9 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"python.testing.pytestEnabled": true,
"python.testing.unittestEnabled": false,
"python.testing.nosetestsEnabled": false,
"python.testing.pytestArgs": ["tests", "-v", "--tb=short"],
"python.testing.autoTestDiscoverOnSaveEnabled": true,
"python.terminal.activateEnvInCurrentTerminal": true,
"python.terminal.shellIntegration.enabled": true
}
17 changes: 16 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,21 @@
- Fix a typo ([#3268](https://github.com/nf-core/tools/pull/3268))
- Remove `def` from `nextflow.config` and add `trace_report_suffix` param ([#3296](https://github.com/nf-core/tools/pull/3296))
- 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))
- Use `params.monochrome_logs` in the template and update nf-core components ([#3310](https://github.com/nf-core/tools/pull/3310))
- Fix some typos and improve writing in `usage.md` and `CONTRIBUTING.md` ([#3302](https://github.com/nf-core/tools/pull/3302))
- Add `manifest.contributors` to `nextflow.config` ([#3311](https://github.com/nf-core/tools/pull/3311))

### Download

- 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)).
- 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)).
- Update dawidd6/action-download-artifact action to v7 ([#3306](https://github.com/nf-core/tools/pull/3306))

### Linting

- General: Run pre-commit when testing linting the template pipeline ([#3280](https://github.com/nf-core/tools/pull/3280))
- allow mixed `str` and `dict` entries in lint config ([#3228](https://github.com/nf-core/tools/pull/3228))
- fix meta_yml linting test failing due to module.process_name always being "" ([#3317](https://github.com/nf-core/tools/pull/3317))
- fix module section regex matching wrong things ([#3321](https://github.com/nf-core/tools/pull/3321))

### Modules

Expand All @@ -29,6 +35,7 @@
### Subworkflows

- Add `nf-core subworkflows patch` command ([#2861](https://github.com/nf-core/tools/pull/2861))
- Improve subworkflow nf-test migration warning ([#3298](https://github.com/nf-core/tools/pull/3298))

### General

Expand All @@ -42,6 +49,7 @@
- Update GitHub Actions ([#3237](https://github.com/nf-core/tools/pull/3237))
- add `--dir/-d` option to schema commands ([#3247](https://github.com/nf-core/tools/pull/3247))
- Update pre-commit hook astral-sh/ruff-pre-commit to v0.7.1 ([#3250](https://github.com/nf-core/tools/pull/3250))
- fix headers in api docs ([#3323](https://github.com/nf-core/tools/pull/3323))
- handle new schema structure in `nf-core pipelines create-params-file` ([#3276](https://github.com/nf-core/tools/pull/3276))
- Update Gitpod image to use Miniforge instead of Miniconda([#3274](https://github.com/nf-core/tools/pull/3274))
- Update pre-commit hook astral-sh/ruff-pre-commit to v0.7.3 ([#3275](https://github.com/nf-core/tools/pull/3275))
Expand All @@ -50,6 +58,13 @@
- Update codecov/codecov-action action to v5 ([#3283](https://github.com/nf-core/tools/pull/3283))
- Update python:3.12-slim Docker digest to 2a6386a ([#3284](https://github.com/nf-core/tools/pull/3284))
- Update pre-commit hook astral-sh/ruff-pre-commit to v0.8.0 ([#3299](https://github.com/nf-core/tools/pull/3299))
- Update gitpod/workspace-base Docker digest to 12853f7 ([#3309](https://github.com/nf-core/tools/pull/3309))
- Run pre-commit when testing linting the template pipeline ([#3280](https://github.com/nf-core/tools/pull/3280))
- Update pre-commit hook astral-sh/ruff-pre-commit to v0.8.2 ([#3325](https://github.com/nf-core/tools/pull/3325))
- Make CLI prompt less nf-core specific ([#3326](https://github.com/nf-core/tools/pull/3326))
- Update gitpod vscode extensions to use nf-core extension pack ([#3327](https://github.com/nf-core/tools/pull/3327))
- Remove toList() channel operation from inside onComplete block ([#3304](https://github.com/nf-core/tools/pull/3304))
- build: Setup VS Code tests ([#3292](https://github.com/nf-core/tools/pull/3292))
- Update dependency textual-dev to v1.7.0 ([#3308](https://github.com/nf-core/tools/pull/3308))

## [v3.0.2 - Titanium Tapir Patch](https://github.com/nf-core/tools/releases/tag/3.0.2) - [2024-10-11]
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM python:3.12-slim@sha256:2a6386ad2db20e7f55073f69a98d6da2cf9f168e05e7487d2670baeb9b7601c5
FROM python:3.12-slim@sha256:2b0079146a74e23bf4ae8f6a28e1b484c6292f6fb904cbb51825b4a19812fcd8
LABEL authors="[email protected],[email protected]" \
description="Docker image containing requirements for nf-core/tools"

Expand Down
2 changes: 1 addition & 1 deletion docs/api/_src/api/pipelines/bump_version.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# nf_core.bump_version
# nf_core.pipelines.bump_version

```{eval-rst}
.. automodule:: nf_core.pipelines.bump_version
Expand Down
2 changes: 1 addition & 1 deletion docs/api/_src/api/pipelines/create.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# nf_core.create
# nf_core.pipelines.create

```{eval-rst}
.. automodule:: nf_core.pipelines.create
Expand Down
2 changes: 1 addition & 1 deletion docs/api/_src/api/pipelines/download.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# nf_core.download
# nf_core.pipelines.download

```{eval-rst}
.. automodule:: nf_core.pipelines.download
Expand Down
2 changes: 1 addition & 1 deletion docs/api/_src/api/pipelines/launch.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# nf_core.launch
# nf_core.pipelines.launch

```{eval-rst}
.. automodule:: nf_core.pipelines.launch
Expand Down
2 changes: 1 addition & 1 deletion docs/api/_src/api/pipelines/lint.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# nf_core.lint
# nf_core.pipelines.lint

:::{seealso}
See the [Lint Tests](/docs/nf-core-tools/api_reference/dev/pipeline_lint_tests) docs for information about specific linting functions.
Expand Down
2 changes: 1 addition & 1 deletion docs/api/_src/api/pipelines/list.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# nf_core.list
# nf_core.pipelines.list

```{eval-rst}
.. automodule:: nf_core.pipelines.list
Expand Down
2 changes: 1 addition & 1 deletion docs/api/_src/api/pipelines/params-file.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# nf_core.params_file
# nf_core.pipelines.params_file

```{eval-rst}
.. automodule:: nf_core.pipelines.params_file
Expand Down
2 changes: 1 addition & 1 deletion docs/api/_src/api/pipelines/schema.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# nf_core.schema
# nf_core.pipelines.schema

```{eval-rst}
.. automodule:: nf_core.pipelines.schema
Expand Down
2 changes: 1 addition & 1 deletion docs/api/_src/api/pipelines/sync.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# nf_core.sync
# nf_core.pipelines.sync

```{eval-rst}
.. automodule:: nf_core.pipelines.sync
Expand Down
2 changes: 1 addition & 1 deletion docs/api/_src/api/pipelines/utils.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# nf_core.utils
# nf_core.pipelines.utils

```{eval-rst}
.. automodule:: nf_core.pipelines.utils
Expand Down
4 changes: 2 additions & 2 deletions nf_core/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ def command_pipelines_create(ctx, name, description, author, version, force, out
@click.option(
"--release",
is_flag=True,
default=os.path.basename(os.path.dirname(os.environ.get("GITHUB_REF", "").strip(" '\""))) == "master"
default=Path(os.environ.get("GITHUB_REF", "").strip(" '\"")).parent.name in ["master", "main"]
and os.environ.get("GITHUB_REPOSITORY", "").startswith("nf-core/")
and not os.environ.get("GITHUB_REPOSITORY", "") == "nf-core/tools",
help="Execute additional checks for release-ready workflows.",
Expand Down Expand Up @@ -2240,7 +2240,7 @@ def command_download(
@click.option(
"--release",
is_flag=True,
default=os.path.basename(os.path.dirname(os.environ.get("GITHUB_REF", "").strip(" '\""))) == "master"
default=Path(os.environ.get("GITHUB_REF", "").strip(" '\"")).parent.name in ["master", "main"]
and os.environ.get("GITHUB_REPOSITORY", "").startswith("nf-core/")
and not os.environ.get("GITHUB_REPOSITORY", "") == "nf-core/tools",
help="Execute additional checks for release-ready workflows.",
Expand Down
4 changes: 2 additions & 2 deletions nf_core/components/components_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@ def get_repo_info(directory: Path, use_prompt: Optional[bool] = True) -> Tuple[P
if not repo_type and use_prompt:
log.warning("'repository_type' not defined in %s", config_fn.name)
repo_type = questionary.select(
"Is this repository an nf-core pipeline or a fork of nf-core/modules?",
"Is this repository a pipeline or a modules repository?",
choices=[
{"name": "Pipeline", "value": "pipeline"},
{"name": "nf-core/modules", "value": "modules"},
{"name": "Modules repository", "value": "modules"},
],
style=nf_core.utils.nfcore_question_style,
).unsafe_ask()
Expand Down
4 changes: 2 additions & 2 deletions nf_core/components/lint/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
from nf_core.components.nfcore_component import NFCoreComponent
from nf_core.modules.modules_json import ModulesJson
from nf_core.pipelines.lint_utils import console
from nf_core.utils import LintConfigType
from nf_core.utils import NFCoreYamlLintConfig
from nf_core.utils import plural_s as _s

log = logging.getLogger(__name__)
Expand Down Expand Up @@ -80,7 +80,7 @@ def __init__(
self.failed: List[LintResult] = []
self.all_local_components: List[NFCoreComponent] = []

self.lint_config: Optional[LintConfigType] = None
self.lint_config: Optional[NFCoreYamlLintConfig] = None
self.modules_json: Optional[ModulesJson] = None

if self.component_type == "modules":
Expand Down
10 changes: 9 additions & 1 deletion nf_core/components/nfcore_component.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ def __init__(
# Initialize the important files
self.main_nf: Path = Path(self.component_dir, "main.nf")
self.meta_yml: Optional[Path] = Path(self.component_dir, "meta.yml")
self.process_name = ""
self.environment_yml: Optional[Path] = Path(self.component_dir, "environment.yml")

component_list = self.component_name.split("/")
Expand Down Expand Up @@ -96,6 +95,8 @@ def __init__(
self.test_yml = None
self.test_main_nf = None

self.process_name: str = self._get_process_name()

def __repr__(self) -> str:
return f"<NFCoreComponent {self.component_name} {self.component_dir} {self.repo_url}>"

Expand Down Expand Up @@ -169,6 +170,13 @@ def _get_included_components_in_chained_tests(self, main_nf_test: Union[Path, st
included_components.append(component)
return included_components

def _get_process_name(self):
with open(self.main_nf) as fh:
for line in fh:
if re.search(r"^\s*process\s*\w*\s*{", line):
return re.search(r"^\s*process\s*(\w*)\s*{.*", line).group(1) or ""
return ""

def get_inputs_from_main_nf(self) -> None:
"""Collect all inputs from the main.nf file."""
inputs: Any = [] # Can be 'list[list[dict[str, dict[str, str]]]]' or 'list[str]'
Expand Down
2 changes: 1 addition & 1 deletion nf_core/gitpod/gitpod.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# docker build -t gitpod:test -f nf_core/gitpod/gitpod.Dockerfile .

# See https://docs.renovatebot.com/docker/#digest-pinning for why a digest is used.
FROM gitpod/workspace-base@sha256:2cc134fe5bd7d8fdbe44cab294925d4bc6d2d178d94624f4c376584a22d1f7b6
FROM gitpod/workspace-base@sha256:12853f7c901eb2b677a549cb112c85f9679d18feb30093bcc63aa252540ecad9

USER root

Expand Down
11 changes: 5 additions & 6 deletions nf_core/modules/lint/main_nf.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,19 +96,19 @@ def main_nf(
for line in iter_lines:
if re.search(r"^\s*process\s*\w*\s*{", line) and state == "module":
state = "process"
if re.search(r"input\s*:", line) and state in ["process"]:
if re.search(r"^\s*input\s*:", line) and state in ["process"]:
state = "input"
continue
if re.search(r"output\s*:", line) and state in ["input", "process"]:
if re.search(r"^\s*output\s*:", line) and state in ["input", "process"]:
state = "output"
continue
if re.search(r"when\s*:", line) and state in ["input", "output", "process"]:
if re.search(r"^\s*when\s*:", line) and state in ["input", "output", "process"]:
state = "when"
continue
if re.search(r"script\s*:", line) and state in ["input", "output", "when", "process"]:
if re.search(r"^\s*script\s*:", line) and state in ["input", "output", "when", "process"]:
state = "script"
continue
if re.search(r"shell\s*:", line) and state in ["input", "output", "when", "process"]:
if re.search(r"^\s*shell\s*:", line) and state in ["input", "output", "when", "process"]:
state = "shell"
continue

Expand Down Expand Up @@ -256,7 +256,6 @@ def check_process_section(self, lines, registry, fix_version, progress_bar):
bioconda_packages = []

# Process name should be all capital letters
self.process_name = lines[0].split()[1]
if all(x.upper() for x in self.process_name):
self.passed.append(("process_capitals", "Process name is in capital letters", self.main_nf))
else:
Expand Down
12 changes: 6 additions & 6 deletions nf_core/pipeline-template/.github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# {{ name }}: Contributing Guidelines
# `{{ name }}`: Contributing Guidelines

Hi there!
Many thanks for taking an interest in improving {{ name }}.
Expand Down Expand Up @@ -64,9 +64,9 @@ These tests are run both with the latest available version of `Nextflow` and als

:warning: Only in the unlikely and regretful event of a release happening with a bug.

- On your own fork, make a new branch `patch` based on `upstream/master`.
- On your own fork, make a new branch `patch` based on `upstream/main` or `upstream/master`.
- Fix the bug, and bump version (X.Y.Z+1).
- A PR should be made on `master` from patch to directly this particular bug.
- Open a pull-request from `patch` to `main`/`master` with the changes.

{% if is_nfcore -%}

Expand All @@ -78,13 +78,13 @@ For further information/help, please consult the [{{ name }} documentation](http

## Pipeline contribution conventions

To make the {{ name }} code and processing logic more understandable for new contributors and to ensure quality, we semi-standardise the way the code and other contributions are written.
To make the `{{ name }}` code and processing logic more understandable for new contributors and to ensure quality, we semi-standardise the way the code and other contributions are written.

### Adding a new step

If you wish to contribute a new step, please use the following coding standards:

1. Define the corresponding input channel into your new process from the expected previous process channel
1. Define the corresponding input channel into your new process from the expected previous process channel.
2. Write the process block (see below).
3. Define the output channel if needed (see below).
4. Add any new parameters to `nextflow.config` with a default (see below).
Expand All @@ -99,7 +99,7 @@ If you wish to contribute a new step, please use the following coding standards:

### Default values

Parameters should be initialised / defined with default values in `nextflow.config` under the `params` scope.
Parameters should be initialised / defined with default values within the `params` scope in `nextflow.config`.

Once there, use `nf-core pipelines schema build` to add to `nextflow_schema.json`.

Expand Down
4 changes: 2 additions & 2 deletions nf_core/pipeline-template/.github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ These are the most common things requested on pull requests (PRs).
Remember that PRs should be made against the dev branch, unless you're preparing a pipeline release.
Learn more about contributing: [CONTRIBUTING.md](https://github.com/{{ name }}/tree/master/.github/CONTRIBUTING.md)
Learn more about contributing: [CONTRIBUTING.md](https://github.com/{{ name }}/tree/{{ default_branch }}/.github/CONTRIBUTING.md)
-->

## PR checklist

- [ ] This comment contains a description of changes (with reason).
- [ ] If you've fixed a bug or added code that should be tested, add tests!
- [ ] If you've added a new tool - have you followed the pipeline conventions in the [contribution docs](https://github.com/{{ name }}/tree/master/.github/CONTRIBUTING.md)
- [ ] If you've added a new tool - have you followed the pipeline conventions in the [contribution docs](https://github.com/{{ name }}/tree/{{ default_branch }}/.github/CONTRIBUTING.md)
{%- if is_nfcore %}
- [ ] If necessary, also make a PR on the {{ name }} _branch_ on the [nf-core/test-datasets](https://github.com/nf-core/test-datasets) repository.
{%- endif %}
Expand Down
3 changes: 2 additions & 1 deletion nf_core/pipeline-template/.github/workflows/awsfulltest.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
name: nf-core AWS full size tests
# This workflow is triggered on PRs opened against the master branch.
# This workflow is triggered on PRs opened against the main/master branch.
# It can be additionally triggered manually with GitHub actions workflow dispatch button.
# It runs the -profile 'test_full' on AWS batch

on:
pull_request:
branches:
- main
- master
workflow_dispatch:
pull_request_review:
Expand Down
Loading

0 comments on commit 4ab2637

Please sign in to comment.