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(