From 767618c3ed54b6a88f28332b85a406866af5c703 Mon Sep 17 00:00:00 2001 From: mirpedrol Date: Tue, 17 Dec 2024 15:05:44 +0100 Subject: [PATCH 1/2] properly parse the names form manifest.contributors --- nf_core/pipelines/rocrate.py | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/nf_core/pipelines/rocrate.py b/nf_core/pipelines/rocrate.py index bc868273c4..f87cc7d8d2 100644 --- a/nf_core/pipelines/rocrate.py +++ b/nf_core/pipelines/rocrate.py @@ -270,20 +270,16 @@ def add_main_authors(self, wf_file: rocrate.model.entity.Entity) -> None: authors = [] if "manifest.author" in self.pipeline_obj.nf_config: authors.extend([a.strip() for a in self.pipeline_obj.nf_config["manifest.author"].split(",")]) - if "manifest.contributor" in self.pipeline_obj.nf_config: - authors.extend( - [ - c.get("name", "").strip() - for c in self.pipeline_obj.nf_config["manifest.contributor"] - if "name" in c - ] - ) + if "manifest.contributors" in self.pipeline_obj.nf_config: + contributors = self.pipeline_obj.nf_config["manifest.contributors"] + names = re.findall(r"name:'([^']+)'", contributors) + authors.extend(names) if not authors: raise KeyError("No authors found") # add manifest authors as maintainer to crate except KeyError: - log.error("No author or contributor fields found in manifest of nextflow.config") + log.error("No author or contributors fields found in manifest of nextflow.config") return # remove duplicates authors = list(set(authors)) From 5ecf5837f497ad7b30e98f1a286f28ae99c23988 Mon Sep 17 00:00:00 2001 From: mirpedrol Date: Tue, 17 Dec 2024 16:09:46 +0100 Subject: [PATCH 2/2] update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 01abde0a61..3365226ded 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,6 +21,7 @@ - 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)) +- Properly parse the names form `manifest.contributors` ([#3364](https://github.com/nf-core/tools/pull/3364)) ### Version updates