Skip to content

Add stub block and migrate emmtyper to topic channels#11377

Merged
HReed1 merged 7 commits intonf-core:masterfrom
HReed1:stub-topics-emmtyper
Apr 29, 2026
Merged

Add stub block and migrate emmtyper to topic channels#11377
HReed1 merged 7 commits intonf-core:masterfrom
HReed1:stub-topics-emmtyper

Conversation

@HReed1
Copy link
Copy Markdown
Contributor

@HReed1 HReed1 commented Apr 29, 2026

Description

Migrates the emmtyper module to use topic channels for version outputs and adds a stub block, addressing both #4570 and #11389.

This is a pilot PR to validate the combined stubs + topics migration pattern before batch-submitting the remaining ~39 modules.

Changes

main.nf

  • Replaced path "versions.yml", emit: versions with single-quoted eval() topic output:
    tuple val("${task.process}"), val('emmtyper'), eval('emmtyper --version 2>&1 | sed "s/^.*emmtyper v//"'), topic: versions, emit: versions_emmtyper
    
  • Removed the cat <<-END_VERSIONS HEREDOC block from the script
  • Added stub: block with touch ${prefix}.tsv

meta.yml (auto-fixed via nf-core modules lint --fix)

  • Replaced versions: output (versions.yml file) with versions_emmtyper: tuple definition
  • Added topics: block below outputs

tests/main.nf.test

  • Added stub test: test("test-emmtyper - stub") with options "-stub"
  • Uses sanitizeOutput(process.out) per nft-utils convention

Validation

  • nf-core modules lint emmtyper51/51 passed, 0 warnings, 0 failures
  • nf-core modules test emmtyper --update --profile dockerAll tests passed, snapshots stable
  • eval() uses single-quoted string with direct pipe (canonical pattern from shapeit5)

PR checklist

Closes #4570 (partial — emmtyper only)
Related to #10832

  • This comment contains a description of changes (with reason).
  • If you've fixed a bug or added code that should be tested, add tests!
  • Remove all TODO statements.
  • Broadcast software version numbers to topic: versions - See version_topics
  • Follow the naming conventions.
  • Follow the parameters requirements.
  • Follow the input/output options guidelines.
  • Add a resource label
  • Use BioConda and BioContainers if possible to fulfil software requirements.
  • Ensure that the test works with either Docker / Singularity. Conda CI tests can be quite flaky:
    • For modules:
      • nf-core modules test emmtyper --profile docker
      • nf-core modules test emmtyper --profile singularity
      • nf-core modules test emmtyper --profile conda

HReed1 added 2 commits April 29, 2026 10:19
- Replace versions.yml HEREDOC with tuple/eval/topic output
- Add stub block with touch for TSV output
- Update meta.yml with versions_emmtyper output and topics block
- Add stub test to main.nf.test

Addresses nf-core#4570 and nf-core#10832
Regenerated via: nf-core modules test emmtyper --update --profile docker
- Updated test-emmtyper snapshot: versions.yml → tuple [EMMTYPER, emmtyper, 0.2.0]
- Created test-emmtyper-stub snapshot
- nf-test 0.9.5 / Nextflow 25.10.4
@heuermh
Copy link
Copy Markdown
Contributor

heuermh commented Apr 29, 2026

I'm not sure why conda tests are failing when docker and singularity look fine, the error appears to be in the version check

    > ERROR ~ Error executing process > 'EMMTYPER (test)'
    > 
    > Caused by:
    >   Unable to evaluate output
    > 
    > 
    > Command executed:
    > 
    >   echo $(emmtyper --version 2>&1) | sed 's/^.*emmtyper v//'
    > 
    > Command exit status:
    >   2
    > 
    > Command output:
    >   bash: -c: line 2: syntax error near unexpected token `('
    >   bash: -c: line 2: `  parser = self.make_parser(ctx)'

- Use single-quoted eval() with direct pipe to prevent Conda CI
  bash syntax errors from Python traceback parentheses
- Add sanitizeOutput() wrapper per nft-utils convention
- Regenerate snapshots with sanitized output format

Fixes conda CI failure reported by @heuermh
Addresses test convention feedback from @famosab
@HReed1
Copy link
Copy Markdown
Contributor Author

HReed1 commented Apr 29, 2026

Thanks for flagging this @heuermh! The issue was the eval() quoting — the echo $() wrapper was capturing Python traceback output containing parentheses, which bash was interpreting as syntax.

Fixed in the latest push: switched to single-quoted eval('emmtyper --version 2>&1 | sed "s/^.*emmtyper v//"') with a direct pipe (matching the canonical pattern from shapeit5). Also added sanitizeOutput() to the test snapshots per @famosab's feedback on #11349.

Comment thread modules/nf-core/emmtyper/meta.yml Outdated
HReed1 and others added 2 commits April 29, 2026 12:07
Remove echo $() wrapper from meta.yml version expressions to match
the corrected single-quoted eval() pattern in main.nf.

Addresses review comment from @SPPearce.
- Switch eval() from CLI --version to python -c import pattern
  for robustness across Docker and Conda environments
- Use prettier-compatible YAML quoting in meta.yml
- Passes: nf-core lint (53/53), prettier --check, nf-test (stable)

Co-authored-by: Seqera AI <ai@seqera.io>
@HReed1
Copy link
Copy Markdown
Contributor Author

HReed1 commented Apr 29, 2026

Thank you @SPPearce for all the feedback. We are current Green on all Github Actions for this PR.

@HReed1 HReed1 enabled auto-merge April 29, 2026 16:27
Comment thread modules/nf-core/emmtyper/meta.yml Outdated
@HReed1 HReed1 added this pull request to the merge queue Apr 29, 2026
Merged via the queue into nf-core:master with commit ea868c3 Apr 29, 2026
23 checks passed
@HReed1 HReed1 deleted the stub-topics-emmtyper branch April 29, 2026 17:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE] Add stub support to every module

4 participants