diff --git a/CHANGELOG.md b/CHANGELOG.md index 01abde0a6..3365226de 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 diff --git a/nf_core/pipelines/rocrate.py b/nf_core/pipelines/rocrate.py index bc868273c..f87cc7d8d 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))