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

3262 Fix pipeline lint bug for pipelines with minimal template features #3265

Draft
wants to merge 2 commits into
base: dev
Choose a base branch
from
Draft
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 @@ -15,6 +15,8 @@

### Linting

- 3262 Fix pipeline lint bug for pipelines with minimal template features ([#3265](https://github.com/nf-core/tools/pull/3265))

### Modules

- add a panel around diff previews when updating ([#3246](https://github.com/nf-core/tools/pull/3246))
Expand Down
22 changes: 8 additions & 14 deletions nf_core/pipelines/lint/files_unchanged.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
from pathlib import Path
from typing import Dict, List, Union

import yaml

import nf_core.pipelines.create.create
import nf_core.utils
from nf_core.pipelines.create.utils import CreateConfig

log = logging.getLogger(__name__)

Expand Down Expand Up @@ -115,22 +115,16 @@ def files_unchanged(self) -> Dict[str, Union[List[str], bool]]:
tmp_dir = Path(tempfile.TemporaryDirectory().name)
tmp_dir.mkdir(parents=True)

# Create a template.yaml file for the pipeline creation
template_yaml = {
"name": short_name,
"description": self.nf_config["manifest.description"].strip("\"'"),
"author": self.nf_config["manifest.author"].strip("\"'"),
"org": prefix,
}

template_yaml_path = Path(tmp_dir, "template.yaml")
_, config_yml = nf_core.utils.load_tools_config(self.wf_path)

with open(template_yaml_path, "w") as fh:
yaml.dump(template_yaml, fh, default_flow_style=False)
if config_yml is not None and getattr(config_yml, "template", None) is not None:
template_config = CreateConfig(**config_yml["template"].model_dump())
else:
raise UserWarning("The template configuration was not provided in '.nf-core.yml'.")

test_pipeline_dir = Path(tmp_dir, f"{prefix}-{short_name}")
create_obj = nf_core.pipelines.create.create.PipelineCreate(
None, None, None, no_git=True, outdir=test_pipeline_dir, template_config=template_yaml_path
None, None, None, no_git=True, outdir=test_pipeline_dir, template_config=template_config
)
create_obj.init_pipeline()

Expand Down
Loading