Repository navigation
Skip included names that are not installed components when recreating installed_by - #4491
pinin4fjords wants to merge 3 commits into
Conversation
…rkflow includes
get_components_to_install treated every include from a module path as a module,
so importing a record type (include { SamtoolsStatsResult } from
'../../../modules/nf-core/samtools/stats/main') made pipelines lint fail with a
KeyError. Only names in capitals (processes and workflows) are components.
Fixes nf-core#4490
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
hmm, not sure I like the capitalisation check actually- bit fragile? I'll see if I can do better |
| name, link = match.groups() | ||
| # Processes and workflows are named in capitals, so another name (a record type, a function) | ||
| # is not a component | ||
| if not re.fullmatch(r"[A-Z0-9_]+", name): |
There was a problem hiding this comment.
| if not re.fullmatch(r"[A-Z0-9_]+", name): | |
| if not name.isUpper(): |
is simpler i guess
There was a problem hiding this comment.
What do you think of the modules.json solution in 837722e instead?
There was a problem hiding this comment.
modules.json isn't a good ground truth, since we often rebuild it on the fly.
Is the problem with checking the capitalization that it is just a convention?
There was a problem hiding this comment.
Yes, exactly. We can go back to that if you think it's better though
… installed_by recreate_dependencies assumed that every name a subworkflow includes is an installed module or subworkflow, so a record type or a function in an include made pipelines lint fail with a KeyError. Only the components that are in modules.json are dependencies; the other names are skipped. This replaces the earlier check on capital letters in the include name. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Fixes #4490
nf-core pipelines lintcrashes withKeyError: 'samtoolsstatsresult'when an installed subworkflow imports a name that is not a process or workflow, such as a record type (typed pipelines,nextflow.enable.types = true; see the record types ADR):include { SamtoolsStatsResult } from '../../../modules/nf-core/samtools/stats/main'recreate_dependenciesassumes that every name a subworkflow includes is an installed module or subworkflow and looks it up inmodules.json. It now skips a name that is not inmodules.json, because only installed components are dependencies. The parsing of the includes is unchanged.The test builds a subworkflow that includes a module, a record type of that module and a function, and checks that
installed_byis recreated for the module. Also checked with the reproducer in #4490:nf-core pipelines lintruns to the end.PR checklist
CHANGELOG.mdis updateddocsis updated (no documentation describes this)