Skip to content

Commit

Permalink
manifest.authors is not mandatory anymore
Browse files Browse the repository at this point in the history
  • Loading branch information
mirpedrol committed Jan 14, 2025
1 parent 4bdf77e commit 225b0b7
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 4 deletions.
13 changes: 11 additions & 2 deletions nf_core/pipelines/lint/files_unchanged.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import filecmp
import logging
import os
import re
import shutil
import tempfile
from pathlib import Path
Expand Down Expand Up @@ -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}"]}
Expand Down Expand Up @@ -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,
}

Expand Down
6 changes: 5 additions & 1 deletion nf_core/pipelines/sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion nf_core/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit 225b0b7

Please sign in to comment.