Skip to content

Comments

Remove --version from uv subcommands#12439

Closed
jtfmumm wants to merge 1 commit intorelease/070from
jtfm/subcommand-version
Closed

Remove --version from uv subcommands#12439
jtfmumm wants to merge 1 commit intorelease/070from
jtfm/subcommand-version

Conversation

@jtfmumm
Copy link
Contributor

@jtfmumm jtfmumm commented Mar 24, 2025

Currently, uv will return the uv version when --version is passed into subcommands, though it is displayed as follows:

$ uv run --version
uv-run 0.6.7 (029b9e1fc 2025-03-17)

We don't actually version subcommands separately and we may want to use the --version flag for other purposes (e.g., #12376). This PR removes this default version from all subcommands. uv --version still works.

Closes #12431

@zanieb zanieb added the breaking A breaking change label Mar 24, 2025
@zanieb zanieb added this to the v0.7.0 milestone Mar 24, 2025
@inoa-jboliveira
Copy link

Hi, I think --version is quite important for uvx since it lacks uvx version and it can be installed standalone without uv.
Is it preserved here?

@jtfmumm
Copy link
Contributor Author

jtfmumm commented Mar 25, 2025

@inoa-jboliveira that’s a good point. I’ll update to cover that.

@jtfmumm jtfmumm temporarily deployed to uv-test-publish March 27, 2025 19:33 — with GitHub Actions Inactive
@zanieb
Copy link
Member

zanieb commented Mar 27, 2025

Can we add a uvx --version to the smoke tests or something? (done in #12516)

@jtfmumm jtfmumm temporarily deployed to uv-test-publish March 27, 2025 19:53 — with GitHub Actions Inactive
@jtfmumm jtfmumm force-pushed the jtfm/subcommand-version branch from f112cae to 14f9951 Compare March 27, 2025 21:19
@jtfmumm
Copy link
Contributor Author

jtfmumm commented Mar 28, 2025

This change invalidates a couple of our old tests that checked that passing --version before the final command (e.g., uv run --version python) would output uv's version and not Python's. I've updated these tests to use --help, but this is testing something slightly different. uv run --help python outputs uv run help, not uv help.

@jtfmumm jtfmumm marked this pull request as ready for review April 1, 2025 06:46
@zanieb zanieb changed the base branch from main to release/070 April 15, 2025 21:55
help Display documentation for a command

Options:
-V, --version Print version
Copy link
Member

Choose a reason for hiding this comment

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

I feel like the old description was better? This feels like a minor regression

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Unfortunately, it seems like you can't update the default version help message when using the clap macro approach. Do you think this regression is a reason to move this out of the release?

Copy link
Member

Choose a reason for hiding this comment

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

Why do we need to use the clap macro? Can't we just make this flag only applicable at the root instead of global?

Copy link
Member

Choose a reason for hiding this comment

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

See #13108

@Gankra Gankra force-pushed the release/070 branch 3 times, most recently from 2a5764a to b230fb6 Compare April 24, 2025 17:26
@jtfmumm
Copy link
Contributor Author

jtfmumm commented Apr 28, 2025

Closing in favor of #13108

@jtfmumm jtfmumm closed this Apr 28, 2025
zanieb added a commit that referenced this pull request Apr 28, 2025
Supersedes #12439 — does not use the
Clap macro so we retain control over the messages
Closes #12431 


0077a67
pulls `uv run` and `uv tool run` test changes from
#12439
zanieb added a commit that referenced this pull request Apr 29, 2025
Supersedes #12439 — does not use the
Clap macro so we retain control over the messages
Closes #12431

0077a67
pulls `uv run` and `uv tool run` test changes from
#12439
zanieb added a commit that referenced this pull request Apr 29, 2025
Supersedes #12439 — does not use the
Clap macro so we retain control over the messages
Closes #12431

0077a67
pulls `uv run` and `uv tool run` test changes from
#12439
@jtfmumm jtfmumm deleted the jtfm/subcommand-version branch June 1, 2025 11:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking A breaking change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

--version shouldn't show the uv version on subcommands

3 participants