Skip to content

Commit

Permalink
handle new author field
Browse files Browse the repository at this point in the history
  • Loading branch information
mashehu committed Dec 10, 2024
1 parent 3e81adb commit 6ae3de5
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions nf_core/pipelines/rocrate.py
Original file line number Diff line number Diff line change
Expand Up @@ -267,14 +267,26 @@ def add_main_authors(self, wf_file: rocrate.model.entity.Entity) -> None:
# add author entity to crate

try:
authors = self.pipeline_obj.nf_config["manifest.author"].split(",")
# remove spaces
authors = [a.strip() for a in authors]
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 not authors:
raise KeyError("No authors found")
# add manifest authors as maintainer to crate

except KeyError:
log.error("No author field found in manifest of nextflow.config")
log.error("No author or contributor fields found in manifest of nextflow.config")
return
# remove duplicates
authors = list(set(authors))
# look at git contributors for author names
try:
git_contributors: Set[str] = set()
Expand Down

0 comments on commit 6ae3de5

Please sign in to comment.