From 745df4deff2cf42fd6f2c2ba11e6911765684d99 Mon Sep 17 00:00:00 2001 From: mirpedrol Date: Tue, 17 Dec 2024 14:33:17 +0100 Subject: [PATCH 1/2] use manifest.contributors names if available, otherwise default to manifest.author --- nf_core/utils.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/nf_core/utils.py b/nf_core/utils.py index dc208c0a78..e2b61329cc 100644 --- a/nf_core/utils.py +++ b/nf_core/utils.py @@ -1327,13 +1327,20 @@ def load_tools_config(directory: Union[str, Path] = ".") -> Tuple[Optional[Path] # Retrieve information if template from config file is empty template = tools_config.get("template") config_template_keys = template.keys() if template is not None else [] + # Get author names from contributors first, then fallback to author + if "manifest.contributors" in wf_config: + contributors = wf_config["manifest.contributors"] + names = re.findall(r"name:'([^']+)'", contributors) + author_names = ", ".join(names) + else: + author_names = wf_config["manifest.author"].strip("'\"") if nf_core_yaml_config.template is None: # The .nf-core.yml file did not contain template information nf_core_yaml_config.template = NFCoreTemplateConfig( org="nf-core", name=wf_config["manifest.name"].strip("'\"").split("/")[-1], description=wf_config["manifest.description"].strip("'\""), - author=wf_config["manifest.author"].strip("'\""), + author=author_names, version=wf_config["manifest.version"].strip("'\""), outdir=str(directory), is_nfcore=True, @@ -1344,7 +1351,7 @@ def load_tools_config(directory: Union[str, Path] = ".") -> Tuple[Optional[Path] org=tools_config["template"].get("prefix", tools_config["template"].get("org", "nf-core")), name=tools_config["template"].get("name", wf_config["manifest.name"].strip("'\"").split("/")[-1]), description=tools_config["template"].get("description", wf_config["manifest.description"].strip("'\"")), - author=tools_config["template"].get("author", wf_config["manifest.author"].strip("'\"")), + author=tools_config["template"].get("author", author_names), version=tools_config["template"].get("version", wf_config["manifest.version"].strip("'\"")), outdir=tools_config["template"].get("outdir", str(directory)), skip_features=tools_config["template"].get("skip", tools_config["template"].get("skip_features")), From ac7fd48f61fd2eb712c86dfea839834353a5181d Mon Sep 17 00:00:00 2001 From: nf-core-bot Date: Tue, 17 Dec 2024 13:35:21 +0000 Subject: [PATCH 2/2] [automated] Update CHANGELOG.md --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 603dd664c6..01abde0a61 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,6 +20,7 @@ ### General - Add missing p ([#3357](https://github.com/nf-core/tools/pull/3357)) +- Use `manifest.contributors` names if available, otherwise default to `manifest.author` ([#3362](https://github.com/nf-core/tools/pull/3362)) ### Version updates