From 4bdf77e28fc1cd29d5d7cc53eb960e09842ea1b0 Mon Sep 17 00:00:00 2001 From: mirpedrol Date: Tue, 14 Jan 2025 16:20:23 +0100 Subject: [PATCH 1/3] make rocrate no git info message a debug message to avoid seeing it every time we run nf-core pipelines lint --- nf_core/pipelines/rocrate.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nf_core/pipelines/rocrate.py b/nf_core/pipelines/rocrate.py index f87cc7d8d2..b0f9611f1f 100644 --- a/nf_core/pipelines/rocrate.py +++ b/nf_core/pipelines/rocrate.py @@ -287,7 +287,7 @@ def add_main_authors(self, wf_file: rocrate.model.entity.Entity) -> None: try: git_contributors: Set[str] = set() if self.pipeline_obj.repo is None: - log.info("No git repository found. No git contributors will be added as authors.") + log.debug("No git repository found. No git contributors will be added as authors.") return commits_touching_path = list(self.pipeline_obj.repo.iter_commits(paths="main.nf")) From 225b0b7ed408db786fb411d65f576526c283277b Mon Sep 17 00:00:00 2001 From: mirpedrol Date: Tue, 14 Jan 2025 16:42:37 +0100 Subject: [PATCH 2/3] manifest.authors is not mandatory anymore --- nf_core/pipelines/lint/files_unchanged.py | 13 +++++++++++-- nf_core/pipelines/sync.py | 6 +++++- nf_core/utils.py | 4 +++- 3 files changed, 19 insertions(+), 4 deletions(-) diff --git a/nf_core/pipelines/lint/files_unchanged.py b/nf_core/pipelines/lint/files_unchanged.py index c1c3acd31f..4dcab3b657 100644 --- a/nf_core/pipelines/lint/files_unchanged.py +++ b/nf_core/pipelines/lint/files_unchanged.py @@ -1,6 +1,7 @@ import filecmp import logging import os +import re import shutil import tempfile from pathlib import Path @@ -68,7 +69,10 @@ def files_unchanged(self) -> Dict[str, Union[List[str], bool]]: could_fix: bool = False # Check that we have the minimum required config - required_pipeline_config = {"manifest.name", "manifest.description", "manifest.author"} + required_pipeline_config = { + "manifest.name", + "manifest.description", + } # TODO: add "manifest.contributors" when minimum nextflow version is >=24.10.0 missing_pipeline_config = required_pipeline_config.difference(self.nf_config) if missing_pipeline_config: return {"ignored": [f"Required pipeline config not found - {missing_pipeline_config}"]} @@ -117,10 +121,15 @@ def files_unchanged(self) -> Dict[str, Union[List[str], bool]]: tmp_dir.mkdir(parents=True) # Create a template.yaml file for the pipeline creation + if "manifest.author" in self.nf_config: + names = self.nf_config["manifest.author"].strip("\"'") + if "manifest.contributors" in self.nf_config: + contributors = self.nf_config["manifest.contributors"] + names = ", ".join(re.findall(r"name:'([^']+)'", contributors)) template_yaml = { "name": short_name, "description": self.nf_config["manifest.description"].strip("\"'"), - "author": self.nf_config["manifest.author"].strip("\"'"), + "author": names, "org": prefix, } diff --git a/nf_core/pipelines/sync.py b/nf_core/pipelines/sync.py index 781b4f5f00..14365da3f8 100644 --- a/nf_core/pipelines/sync.py +++ b/nf_core/pipelines/sync.py @@ -81,7 +81,11 @@ def __init__( self.made_changes = False self.make_pr = make_pr self.gh_pr_returned_data: Dict = {} - self.required_config_vars = ["manifest.name", "manifest.description", "manifest.version", "manifest.author"] + self.required_config_vars = [ + "manifest.name", + "manifest.description", + "manifest.version", + ] # TODO: add "manifest.contributors" when minimum nextflow version is >=24.10.0 self.force_pr = force_pr self.gh_username = gh_username diff --git a/nf_core/utils.py b/nf_core/utils.py index 2ac0943c59..27334d473c 100644 --- a/nf_core/utils.py +++ b/nf_core/utils.py @@ -1352,8 +1352,10 @@ def load_tools_config(directory: Union[str, Path] = ".") -> Tuple[Optional[Path] contributors = wf_config["manifest.contributors"] names = re.findall(r"name:'([^']+)'", contributors) author_names = ", ".join(names) - else: + elif "manifest.author" in wf_config: author_names = wf_config["manifest.author"].strip("'\"") + else: + author_names = None if nf_core_yaml_config.template is None: # The .nf-core.yml file did not contain template information nf_core_yaml_config.template = NFCoreTemplateConfig( From 7641e5f84ca3768407fb1f4d1ffc0d0dfd07f815 Mon Sep 17 00:00:00 2001 From: nf-core-bot Date: Tue, 14 Jan 2025 15:52:19 +0000 Subject: [PATCH 3/3] [automated] Update CHANGELOG.md --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 35615729c0..0e001fed6b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,6 +21,7 @@ - Parameters schema validation: allow oneOf, anyOf and allOf with `required` ([#3386](https://github.com/nf-core/tools/pull/3386)) - Run pre-comit when rendering template for pipelines sync ([#3371](https://github.com/nf-core/tools/pull/3371)) +- manifest.author is not required anymore ([#3397](https://github.com/nf-core/tools/pull/3397)) ### Version updates