Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

only check pipeline name without dashes if the name is provided by prompt #2123

Merged
merged 5 commits into from
Dec 13, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@

### General

- Only check that a pipeline name doesn't contain dashes if the name is provided by prompt of `--name`. Don't check if a template file is used. ([#2123](https://github.com/nf-core/tools/pull/2123))

## [v2.7.1 - Mercury Eagle Patch](https://github.com/nf-core/tools/releases/tag/2.7.1) - [2022-12-08]

- Patch release to fix pipeline sync ([#2110](https://github.com/nf-core/tools/pull/2110))
Expand Down
7 changes: 4 additions & 3 deletions nf_core/create.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,9 +173,10 @@ def create_param_dict(self, name, description, author, version, template_yaml_pa
and "manifest.name" in config_yml["lint"]["nextflow_config"]
):
return param_dict, skip_paths
# Check that the pipeline name matches the requirements
if not re.match(r"^[a-z]+$", param_dict["short_name"]):
raise UserWarning("[red]Invalid workflow name: must be lowercase without punctuation.")
if param_dict["prefix"] == "nf-core":
# Check that the pipeline name matches the requirements
if not re.match(r"^[a-z]+$", param_dict["short_name"]):
raise UserWarning("[red]Invalid workflow name: must be lowercase without punctuation.")

return param_dict, skip_paths

Expand Down
5 changes: 3 additions & 2 deletions nf_core/sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -252,8 +252,9 @@ def make_template_pipeline(self):
plain=True,
).init_pipeline()
except Exception as err:
# If sync fails, remove template_yaml_path before raising error.
os.remove(self.template_yaml_path)
if self.template_yaml_path:
# If sync fails, remove template_yaml_path before raising error.
os.remove(self.template_yaml_path)
# Reset to where you were to prevent git getting messed up.
self.repo.git.reset("--hard")
raise SyncException(f"Failed to rebuild pipeline from template with error:\n{err}")
Expand Down