Skip to content

Commit 6680f41

Browse files
authored
Merge pull request #3397 from mirpedrol/make-author-not-required
General: manifest.author is not required anymore
2 parents 65969d9 + 7641e5f commit 6680f41

File tree

5 files changed

+21
-5
lines changed

5 files changed

+21
-5
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121

2222
- Parameters schema validation: allow oneOf, anyOf and allOf with `required` ([#3386](https://github.com/nf-core/tools/pull/3386))
2323
- Run pre-comit when rendering template for pipelines sync ([#3371](https://github.com/nf-core/tools/pull/3371))
24+
- manifest.author is not required anymore ([#3397](https://github.com/nf-core/tools/pull/3397))
2425

2526
### Version updates
2627

nf_core/pipelines/lint/files_unchanged.py

+11-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import filecmp
22
import logging
33
import os
4+
import re
45
import shutil
56
import tempfile
67
from pathlib import Path
@@ -68,7 +69,10 @@ def files_unchanged(self) -> Dict[str, Union[List[str], bool]]:
6869
could_fix: bool = False
6970

7071
# Check that we have the minimum required config
71-
required_pipeline_config = {"manifest.name", "manifest.description", "manifest.author"}
72+
required_pipeline_config = {
73+
"manifest.name",
74+
"manifest.description",
75+
} # TODO: add "manifest.contributors" when minimum nextflow version is >=24.10.0
7276
missing_pipeline_config = required_pipeline_config.difference(self.nf_config)
7377
if missing_pipeline_config:
7478
return {"ignored": [f"Required pipeline config not found - {missing_pipeline_config}"]}
@@ -117,10 +121,15 @@ def files_unchanged(self) -> Dict[str, Union[List[str], bool]]:
117121
tmp_dir.mkdir(parents=True)
118122

119123
# Create a template.yaml file for the pipeline creation
124+
if "manifest.author" in self.nf_config:
125+
names = self.nf_config["manifest.author"].strip("\"'")
126+
if "manifest.contributors" in self.nf_config:
127+
contributors = self.nf_config["manifest.contributors"]
128+
names = ", ".join(re.findall(r"name:'([^']+)'", contributors))
120129
template_yaml = {
121130
"name": short_name,
122131
"description": self.nf_config["manifest.description"].strip("\"'"),
123-
"author": self.nf_config["manifest.author"].strip("\"'"),
132+
"author": names,
124133
"org": prefix,
125134
}
126135

nf_core/pipelines/rocrate.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ def add_main_authors(self, wf_file: rocrate.model.entity.Entity) -> None:
287287
try:
288288
git_contributors: Set[str] = set()
289289
if self.pipeline_obj.repo is None:
290-
log.info("No git repository found. No git contributors will be added as authors.")
290+
log.debug("No git repository found. No git contributors will be added as authors.")
291291
return
292292
commits_touching_path = list(self.pipeline_obj.repo.iter_commits(paths="main.nf"))
293293

nf_core/pipelines/sync.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,11 @@ def __init__(
8181
self.made_changes = False
8282
self.make_pr = make_pr
8383
self.gh_pr_returned_data: Dict = {}
84-
self.required_config_vars = ["manifest.name", "manifest.description", "manifest.version", "manifest.author"]
84+
self.required_config_vars = [
85+
"manifest.name",
86+
"manifest.description",
87+
"manifest.version",
88+
] # TODO: add "manifest.contributors" when minimum nextflow version is >=24.10.0
8589
self.force_pr = force_pr
8690

8791
self.gh_username = gh_username

nf_core/utils.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -1352,8 +1352,10 @@ def load_tools_config(directory: Union[str, Path] = ".") -> Tuple[Optional[Path]
13521352
contributors = wf_config["manifest.contributors"]
13531353
names = re.findall(r"name:'([^']+)'", contributors)
13541354
author_names = ", ".join(names)
1355-
else:
1355+
elif "manifest.author" in wf_config:
13561356
author_names = wf_config["manifest.author"].strip("'\"")
1357+
else:
1358+
author_names = None
13571359
if nf_core_yaml_config.template is None:
13581360
# The .nf-core.yml file did not contain template information
13591361
nf_core_yaml_config.template = NFCoreTemplateConfig(

0 commit comments

Comments
 (0)