|
1 | 1 | import filecmp
|
2 | 2 | import logging
|
3 | 3 | import os
|
| 4 | +import re |
4 | 5 | import shutil
|
5 | 6 | import tempfile
|
6 | 7 | from pathlib import Path
|
@@ -68,7 +69,10 @@ def files_unchanged(self) -> Dict[str, Union[List[str], bool]]:
|
68 | 69 | could_fix: bool = False
|
69 | 70 |
|
70 | 71 | # 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 |
72 | 76 | missing_pipeline_config = required_pipeline_config.difference(self.nf_config)
|
73 | 77 | if missing_pipeline_config:
|
74 | 78 | 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]]:
|
117 | 121 | tmp_dir.mkdir(parents=True)
|
118 | 122 |
|
119 | 123 | # 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)) |
120 | 129 | template_yaml = {
|
121 | 130 | "name": short_name,
|
122 | 131 | "description": self.nf_config["manifest.description"].strip("\"'"),
|
123 |
| - "author": self.nf_config["manifest.author"].strip("\"'"), |
| 132 | + "author": names, |
124 | 133 | "org": prefix,
|
125 | 134 | }
|
126 | 135 |
|
|
0 commit comments