Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
fd0016c
bump version to 3.2.0dev
mirpedrol Jan 20, 2025
0716d91
Merge pull request #3409 from mirpedrol/bump-to-3.2.0
mirpedrol Jan 20, 2025
c1692f5
fix(1929): more type-gating
awgymer Oct 28, 2024
90978ea
fix CHANGELOG.md
nf-core-bot Oct 28, 2024
a5bb0f0
fix(1929): update subworkflow tests and add lint test markdown
awgymer Oct 28, 2024
732c786
Apply suggestions from code review
awgymer Oct 29, 2024
7ba6f79
feat(1929): allow missing files when linting local modules
awgymer Oct 29, 2024
8a1d44a
feat(1929): local linting option now *only* lints local modules. Add …
awgymer Oct 29, 2024
6c9c1b1
feat(1929): don't ask for a module/subworkflow name to lint if lintin…
awgymer Oct 29, 2024
19df044
feat(1929): add test for new pipeline lint check of local component dirs
awgymer Oct 29, 2024
5d1d44b
feat(1929): run todo linting on local subworkflows
awgymer Oct 30, 2024
5689ff6
fix: Update to latest CHANGELOG
awgymer Jan 21, 2025
3f76e99
fix: Clean up CHANGELOG.md
awgymer Jan 21, 2025
660c8a7
Update pre-commit hook editorconfig-checker/editorconfig-checker.pyth…
renovate[bot] Jan 21, 2025
8d33662
[automated] Update CHANGELOG.md
nf-core-bot Jan 21, 2025
d1f6dc7
Fix 'process.shell' in nextflow.config
ewels Jan 21, 2025
ca8b93d
Merge branch 'dev' into fix-process-shell
mashehu Jan 21, 2025
702e00c
[automated] Update CHANGELOG.md
nf-core-bot Jan 21, 2025
0b6b151
Merge pull request #3416 from ewels/fix-process-shell
ewels Jan 21, 2025
bee0520
Remove automated release tweets
ewels Jan 21, 2025
078e4ee
[automated] Update CHANGELOG.md
nf-core-bot Jan 21, 2025
48ee89c
[automated] Update CHANGELOG.md
nf-core-bot Jan 21, 2025
ed1667f
Merge pull request #3419 from ewels/remove-twitter-release-notifications
ewels Jan 21, 2025
391ae2c
Merge branch 'dev' into 1929-local-modules-use-remote-format
awgymer Jan 22, 2025
3dd2e00
fix: broken test. Need to assign component_dir to the parent dir if a…
awgymer Jan 22, 2025
262dea3
fix: Add new lint test to lint config pydantic model
awgymer Jan 22, 2025
583809c
Update python:3.12-slim Docker digest to 123be56 (#3421)
renovate[bot] Jan 23, 2025
1283406
Update pre-commit hook astral-sh/ruff-pre-commit to v0.9.3
renovate[bot] Jan 23, 2025
52e8d4b
[automated] Fix code linting
nf-core-bot Jan 23, 2025
bc3417a
Merge pull request #3256 from awgymer/1929-local-modules-use-remote-f…
awgymer Jan 24, 2025
3048627
Merge branch 'dev' into renovate/astral-sh-ruff-pre-commit-0.x
mashehu Jan 27, 2025
3be4b60
chore(deps): update dawidd6/action-download-artifact action to v8 (#3…
renovate[bot] Jan 27, 2025
61d9710
fix mypy error
mashehu Jan 27, 2025
2f71183
Merge pull request #3413 from nf-core/renovate/astral-sh-ruff-pre-com…
mashehu Jan 27, 2025
dcf27d9
Merge branch 'dev' into renovate/editorconfig-checker-editorconfig-ch…
mashehu Jan 27, 2025
f8b099c
Separate -o pipefail into separate list elements
ewels Jan 27, 2025
2d7e1a6
[automated] Update CHANGELOG.md
nf-core-bot Jan 27, 2025
df9d892
Merge pull request #3414 from nf-core/renovate/editorconfig-checker-e…
mashehu Jan 27, 2025
2e01c36
Merge pull request #3425 from ewels/o-pipefail-newline
ewels Jan 27, 2025
008dabb
update template components
mirpedrol Jan 27, 2025
ae92258
[automated] Update CHANGELOG.md
nf-core-bot Jan 27, 2025
5236c85
Merge pull request #3426 from mirpedrol/update-template-modules
mirpedrol Jan 27, 2025
92408c3
bump to v3.2.0
mirpedrol Jan 27, 2025
0d9a4f1
template line break fixes
mirpedrol Jan 27, 2025
a7d86d8
Merge pull request #3427 from mirpedrol/bump-to-3.2.0
mirpedrol Jan 27, 2025
381a6b4
update changelog
mirpedrol Jan 27, 2025
0355435
Merge pull request #3429 from mirpedrol/changelog-updates
mirpedrol Jan 27, 2025
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: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.8.6
rev: v0.9.3
hooks:
- id: ruff # linter
args: [--fix, --exit-non-zero-on-fix] # sort imports and fix
Expand Down
4 changes: 1 addition & 3 deletions nf_core/components/components_differ.py
Original file line number Diff line number Diff line change
Expand Up @@ -271,9 +271,7 @@ def print_diff(
console = Console(force_terminal=nf_core.utils.rich_force_colors())
if current_version is not None and new_version is not None:
log.info(
f"Changes in component '{Path(repo_path, component)}' between"
f" ({current_version}) and"
f" ({new_version})"
f"Changes in component '{Path(repo_path, component)}' between ({current_version}) and ({new_version})"
)
else:
log.info(f"Changes in component '{Path(repo_path, component)}'")
Expand Down
4 changes: 2 additions & 2 deletions nf_core/components/info.py
Original file line number Diff line number Diff line change
Expand Up @@ -265,9 +265,9 @@ def generate_component_info_help(self):
intro_text.append(
Text.from_markup(
":globe_with_meridians: Repository: "
f"{ '[link={self.remote_location}]' if self.remote_location.startswith('http') else ''}"
f"{'[link={self.remote_location}]' if self.remote_location.startswith('http') else ''}"
f"{self.remote_location}"
f"{'[/link]' if self.remote_location.startswith('http') else '' }"
f"{'[/link]' if self.remote_location.startswith('http') else ''}"
"\n"
)
)
Expand Down
2 changes: 1 addition & 1 deletion nf_core/components/lint/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ def __init__(
continue
if isinstance(components, str):
raise LookupError(
f"Error parsing modules.json: {components}. " f"Please check the file for errors or try again."
f"Error parsing modules.json: {components}. Please check the file for errors or try again."
)
for org, comp in components:
self.all_remote_components.append(
Expand Down
2 changes: 1 addition & 1 deletion nf_core/components/remove.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,6 @@ def remove(self, component, removed_by=None, removed_components=None, force=Fals
f"Did not remove '{component}', because it was also manually installed. Only updated 'installed_by' entry in modules.json."
)
log.info(
f"""Did not remove {self.component_type[:-1]} '{component}', because it was also installed by {', '.join(f"'{d}'" for d in installed_by)}. Only updated the 'installed_by' entry in modules.json."""
f"""Did not remove {self.component_type[:-1]} '{component}', because it was also installed by {", ".join(f"'{d}'" for d in installed_by)}. Only updated the 'installed_by' entry in modules.json."""
)
return removed
4 changes: 2 additions & 2 deletions nf_core/modules/lint/meta_yml.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def meta_yml(module_lint_object: ComponentLint, module: NFCoreComponent, allow_m
).get("meta.yml")
if lines is not None:
yaml = ruamel.yaml.YAML()
meta_yaml = yaml.safe_load("".join(lines))
meta_yaml = yaml.load("".join(lines))
if meta_yaml is None:
module.failed.append(("meta_yml_exists", "Module `meta.yml` does not exist", module.meta_yml))
return
Expand All @@ -82,7 +82,7 @@ def meta_yml(module_lint_object: ComponentLint, module: NFCoreComponent, allow_m
if len(e.path) > 0:
hint = f"\nCheck the entry for `{e.path[0]}`."
if e.message.startswith("None is not of type 'object'") and len(e.path) > 2:
hint = f"\nCheck that the child entries of {str(e.path[0])+'.'+str(e.path[2])} are indented correctly."
hint = f"\nCheck that the child entries of {str(e.path[0]) + '.' + str(e.path[2])} are indented correctly."
if e.schema and isinstance(e.schema, dict) and "message" in e.schema:
e.message = e.schema["message"]
incorrect_value = meta_yaml
Expand Down
6 changes: 3 additions & 3 deletions nf_core/pipelines/download.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ def download_workflow(self):
raise DownloadError(e) from e

summary_log = [
f"Pipeline revision: '{', '.join(self.revision) if len(self.revision) < 5 else self.revision[0]+',['+str(len(self.revision)-2)+' more revisions],'+self.revision[-1]}'",
f"Pipeline revision: '{', '.join(self.revision) if len(self.revision) < 5 else self.revision[0] + ',[' + str(len(self.revision) - 2) + ' more revisions],' + self.revision[-1]}'",
f"Use containers: '{self.container_system}'",
]
if self.container_system:
Expand Down Expand Up @@ -1908,8 +1908,8 @@ def __init__(

log.error(self.error_type.message)
log.info(self.error_type.helpmessage)
log.debug(f'Failed command:\n{" ".join(singularity_command)}')
log.debug(f'Singularity error messages:\n{"".join(error_msg)}')
log.debug(f"Failed command:\n{' '.join(singularity_command)}")
log.debug(f"Singularity error messages:\n{''.join(error_msg)}")

raise self.error_type

Expand Down
2 changes: 1 addition & 1 deletion nf_core/pipelines/lint/multiqc_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ def multiqc_config(self) -> Dict[str, List[str]]:
f"The expected comment is: \n"
f"```{hint}``` \n"
f"The current comment is: \n"
f"```{ mqc_yml['report_comment'].strip()}```"
f"```{mqc_yml['report_comment'].strip()}```"
)
else:
passed.append("`assets/multiqc_config.yml` contains a matching 'report_comment'.")
Expand Down
2 changes: 1 addition & 1 deletion nf_core/pipelines/lint/version_consistency.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def version_consistency(self):
# Check if they are consistent
if len(set(versions.values())) != 1:
failed.append(
"The versioning is not consistent between container, release tag " "and config. Found {}".format(
"The versioning is not consistent between container, release tag and config. Found {}".format(
", ".join([f"{k} = {v}" for k, v in versions.items()])
)
)
Expand Down
4 changes: 2 additions & 2 deletions nf_core/pipelines/params_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"of nextflow run with the {pipeline_name} pipeline."
)

USAGE = "Uncomment lines with a single '#' if you want to pass the parameter " "to the pipeline."
USAGE = "Uncomment lines with a single '#' if you want to pass the parameter to the pipeline."

H1_SEPERATOR = "## ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
H2_SEPERATOR = "## ----------------------------------------------------------------------------"
Expand Down Expand Up @@ -107,7 +107,7 @@ def get_pipeline(self) -> Optional[bool]:
# Prompt for pipeline if not supplied
if self.pipeline is None:
launch_type = questionary.select(
"Generate parameter file for local pipeline " "or remote GitHub pipeline?",
"Generate parameter file for local pipeline or remote GitHub pipeline?",
choices=["Remote pipeline", "Local path"],
style=nf_core.utils.nfcore_question_style,
).unsafe_ask()
Expand Down
2 changes: 1 addition & 1 deletion nf_core/pipelines/rocrate.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ def set_main_entity(self, main_entity_filename: str):
else:
url = self.version
self.crate.mainEntity.append_to(
"url", f"https://nf-co.re/{self.crate.name.replace('nf-core/','')}/{url}/", compact=True
"url", f"https://nf-co.re/{self.crate.name.replace('nf-core/', '')}/{url}/", compact=True
)
self.crate.mainEntity.append_to("version", self.version, compact=True)

Expand Down
2 changes: 1 addition & 1 deletion nf_core/pipelines/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -770,7 +770,7 @@ def build_schema(self, pipeline_dir, no_prompts, web_only, url):
if self.web_schema_build_web_url:
log.info(
"To save your work, open {}\n"
f"Click the blue 'Finished' button, copy the schema and paste into this file: { self.web_schema_build_web_url, self.schema_filename}"
f"Click the blue 'Finished' button, copy the schema and paste into this file: {self.web_schema_build_web_url, self.schema_filename}"
)
return False

Expand Down
2 changes: 1 addition & 1 deletion nf_core/pipelines/sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ def create_merge_base_branch(self):
if merge_branch_format.match(branch)
]
)
new_branch = f"{self.original_merge_branch}-{max_branch+1}"
new_branch = f"{self.original_merge_branch}-{max_branch + 1}"
log.info(f"Branch already existed: '{self.merge_branch}', creating branch '{new_branch}' instead.")
self.merge_branch = new_branch

Expand Down
7 changes: 4 additions & 3 deletions nf_core/subworkflows/lint/meta_yml.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from pathlib import Path

import jsonschema.validators
import yaml
import ruamel.yaml

import nf_core.components.components_utils
from nf_core.components.lint import LintExceptionError
Expand Down Expand Up @@ -43,7 +43,8 @@ def meta_yml(subworkflow_lint_object, subworkflow, allow_missing: bool = False):

try:
with open(subworkflow.meta_yml) as fh:
meta_yaml = yaml.safe_load(fh)
yaml = ruamel.yaml.YAML(typ="safe")
meta_yaml = yaml.load(fh)
subworkflow.passed.append(("meta_yml_exists", "Subworkflow `meta.yml` exists", subworkflow.meta_yml))
except FileNotFoundError:
subworkflow.failed.append(("meta_yml_exists", "Subworkflow `meta.yml` does not exist", subworkflow.meta_yml))
Expand All @@ -62,7 +63,7 @@ def meta_yml(subworkflow_lint_object, subworkflow, allow_missing: bool = False):
if len(e.path) > 0:
hint = f"\nCheck the entry for `{e.path[0]}`."
if e.message.startswith("None is not of type 'object'") and len(e.path) > 2:
hint = f"\nCheck that the child entries of {e.path[0]}.{e.path[2]} are indented correctly."
hint = f"\nCheck that the child entries of {str(e.path[0]) + '.' + str(e.path[2])} are indented correctly."
subworkflow.failed.append(
(
"meta_yml_valid",
Expand Down
18 changes: 9 additions & 9 deletions tests/modules/test_lint.py
Original file line number Diff line number Diff line change
Expand Up @@ -296,15 +296,15 @@ def test_modules_lint_check_url(self):
if line.strip():
check_container_link_line(mocked_ModuleLint, line, registry="quay.io")

assert (
len(mocked_ModuleLint.passed) == passed
), f"{test}: Expected {passed} PASS, got {len(mocked_ModuleLint.passed)}."
assert (
len(mocked_ModuleLint.warned) == warned
), f"{test}: Expected {warned} WARN, got {len(mocked_ModuleLint.warned)}."
assert (
len(mocked_ModuleLint.failed) == failed
), f"{test}: Expected {failed} FAIL, got {len(mocked_ModuleLint.failed)}."
assert len(mocked_ModuleLint.passed) == passed, (
f"{test}: Expected {passed} PASS, got {len(mocked_ModuleLint.passed)}."
)
assert len(mocked_ModuleLint.warned) == warned, (
f"{test}: Expected {warned} WARN, got {len(mocked_ModuleLint.warned)}."
)
assert len(mocked_ModuleLint.failed) == failed, (
f"{test}: Expected {failed} FAIL, got {len(mocked_ModuleLint.failed)}."
)

def test_modules_lint_update_meta_yml(self):
"""update the meta.yml of a module"""
Expand Down
10 changes: 6 additions & 4 deletions tests/pipelines/test_create.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,9 +158,9 @@ def test_template_customisation_all_files_grouping(self):
str_path = str((Path(root) / file).relative_to(PIPELINE_TEMPLATE))
if str_path not in base_required_files:
try:
assert (
str_path in all_skipped_files
), f"Template file `{str_path}` not present in a group for pipeline customisation in `template_features.yml`."
assert str_path in all_skipped_files, (
f"Template file `{str_path}` not present in a group for pipeline customisation in `template_features.yml`."
)
except AssertionError:
if "/" in str_path:
# Check if the parent directory is in the skipped files
Expand All @@ -170,6 +170,8 @@ def test_template_customisation_all_files_grouping(self):
if upper_dir in all_skipped_files:
upper_dir_present = True
break
assert upper_dir_present, f"Template file `{str_path}` not present in a group for pipeline customisation in `template_features.yml`."
assert upper_dir_present, (
f"Template file `{str_path}` not present in a group for pipeline customisation in `template_features.yml`."
)
else:
raise
Loading