-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
change uv version
to be an interface for project version reads and edits
#12349
base: main
Are you sure you want to change the base?
Conversation
I didn't explore this in my document because I was focused on |
I think i like |
Oh worth noting that this does not also support |
Agree |
One possible reason to use project over metadata is that pixi uses project. |
Not sure it fits in this PR, but you could add a show-bump like: https://callowayproject.github.io/bump-my-version/reference/cli/#bump-my-version-show-bump |
Actually it could just be some side effect of a --dry-run with no target maybe? |
Yeah that's |
I'm sort of leaning towards transitioning |
I'm a tad more in favor of |
Perhaps a future thought, given feature requests like #6794 could this interface evolve towards supporting updating dependency versions in pyproject.toml as well (as it would follow semantics similar to bump) or would you still see that being part of other existing/new top-level interfaces? |
I have a use case for this command: In-editor version bumping (currently this feature relies on Rye). I like the command's design in whole. One minor annoyance is that |
Simply |
Hi there! Just my 2 cents on this:
Would it make sense to include a warning indicating that the command is experimental and subject to future changes? Similar to the warning that was shown with uv publish. Printing the warning to stderr shouldn't interfere with scripted usage, and will allow to 1) defer commitment on the interface and 2) start collecting usage feedback. |
I think we'll probably create a top-level interface for that since other dependency management commands are there, but I'm not sure yet. That design work is planned to happen soon. My thoughts about an expansion of the |
I guess I could just clone, build and test this locally, but I thought it might be easier just to ask the question: how does this cope with |
The current implementation errors the command on all operations if the I should do a cleanup pass on the message though. |
Pushed up a version of
I left out the actual step of replacing the current The existence of |
uv metadata version
commanduv version
to be an interface for project version reads and edits
Ok, updated the main comment and pushed up the latest changes |
crates/uv/tests/it/version.rs
Outdated
running `uv self version` for compatibility with old `uv version` command. | ||
this fallback will be removed soon, pass `--project .` to make this an error. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reading this... I wonder if we should suggest --preview
to make this an error? --project .
is a weird thing for someone to keep around later?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Conversely --preview
will enable a ton of random other things right..? Maybe that's fine though.
Pushed up tweaks -- only thing not done is the |
Added the |
This is Great ❤️ |
This is a reimplementation of #7248 with a new CLI interface.
The old
uv version
is nowuv self version
(also it has gained a--short
flag for parity).The new
uv version
is now an interface for getting/setting the project version.To give a modicum of support for migration, if
uv version
is run and we fail to find/read apyproject.toml
we will fallback touv self version
.uv version --project .
prevents this fallback from being allowed.The new API of
uv version
is as follows:--bump major|minor|patch
to semver-bump the project version--dry-run
to show the result but not apply it--short
to have the final printout contain only the final version--output-format json
to get the final printout as jsonFixes #6298