+
Skip to content

feat: nf-core modules bump-version supports specifying the toolkit #3608

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

Open
wants to merge 11 commits into
base: dev
Choose a base branch
from

Conversation

nh13
Copy link
Member

@nh13 nh13 commented Jun 5, 2025

Tools like picard, fgbio, and samtools all have sub-commands. It is onerous to have to update them all individually using nf-core modules bump-version. This change allows the module name to update to have a trailing forward slash, which will be interpreted as specifying that all subcommands should be updated. E.g. nf-core modules bump-version samtools/

PR checklist

  • This comment contains a description of changes (with reason)
  • CHANGELOG.md is updated
  • If you've fixed a bug or added code that should be tested, add tests!
  • Documentation in docs is updated

mashehu and others added 2 commits June 2, 2025 16:22
Tools like picard, fgbio, and samtools all have sub-commands.  It is
onerous to have to update them all individually using nf-core modules
bump-version.  This change allows the module name to update to have a
trailing forward slash, which will be interpreted as specifying that all
subcommands should be updated.  E.g. nf-core modules bump-version
samtools/

This comment was marked as outdated.

@mashehu mashehu changed the base branch from main to dev June 6, 2025 05:59
Copy link
Contributor

@mashehu mashehu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR.

Could you please also add a unit test for this?

@nh13 nh13 force-pushed the feat/bump-versions-for-sub-modules branch from 2753566 to 2052819 Compare June 7, 2025 00:51
@nh13 nh13 force-pushed the feat/bump-versions-for-sub-modules branch from 2052819 to a5b9730 Compare June 7, 2025 01:00
module: Union[str, None] = None,
all_modules: bool = False,
show_uptodate: bool = False,
_dryrun: bool = False,
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

adding dryrun was much easier to mock and test, so I went this route.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good idea in general. I added it as a parameter

@nh13 nh13 requested a review from mashehu June 8, 2025 20:08
@nh13 nh13 enabled auto-merge June 8, 2025 20:11
Copy link

codecov bot commented Jun 8, 2025

Codecov Report

Attention: Patch coverage is 82.35294% with 3 lines in your changes missing coverage. Please review.

Project coverage is 76.87%. Comparing base (adad597) to head (1896876).

Files with missing lines Patch % Lines
nf_core/__main__.py 75.00% 1 Missing ⚠️
nf_core/commands_modules.py 50.00% 1 Missing ⚠️
nf_core/modules/bump_versions.py 90.90% 1 Missing ⚠️

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@nh13
Copy link
Member Author

nh13 commented Jun 8, 2025

@mashehu thank-you for the review, I've added a test and improved a few others while I'm there.

@mashehu
Copy link
Contributor

mashehu commented Jun 16, 2025

hinking about it:
I think a better command syntax would be simple to check if the input is a parent directory to sub-commands instead of requiring a / at the end

@nh13
Copy link
Member Author

nh13 commented Jun 16, 2025

@mashehu that makes sense, but is difficult in the current state of implementation where we have a list of component names to filter against, not directories. An alternative would be to check for an exact matching component name, and if not found, append a / and check for the prefix.

Copy link
Contributor

mashehu commented Jul 7, 2025

I tried to implement the more general matching approach, could you have a look @nh13 ?

Copy link
Member Author

@nh13 nh13 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mashehu lgtm, with the one caveat that the API has changed for bump_versions in case we want to follow semver

self,
module: Optional[str] = None,
all_modules: bool = False,
show_up_to_date: bool = False,
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nitpick(non-blocking)
Since this method is public, the API has changed. Does this require a major version change as per semver?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nope, we didn't break any backwards functionality. This will be in 3.4.0

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The function signature changed, and the function is public.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, but I don't know anybody who uses nf-core/tools not in CLI mode, so no breaking changes there (we are not ultra-strict semveristas here 🙂)

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.

2 participants
点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载