Skip to content
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

How to correctly automatically version bump #7672

Closed
yannsartori opened this issue Sep 24, 2024 · 4 comments · Fixed by #7694
Closed

How to correctly automatically version bump #7672

yannsartori opened this issue Sep 24, 2024 · 4 comments · Fixed by #7694
Assignees
Labels
documentation Improvements or additions to documentation

Comments

@yannsartori
Copy link

Hello,

I currently use bumpver to automatically version bump my project in CI (realistically, all this tool does from a "versioning" perspective is search and replacing). In particular, it updates the version key in my pyproject.toml file.

The flow is thus merge new feature into main as its own commit -> automatically change these files with version specifiers (just pyproject.toml) -> commit the changes as a version bump change.

However, I noticed by manually inspecting my uv.lock that it also maintains a version key for my project. I try to run all my commands with --frozen to keep my uv.lock file as unchanged as possible, so this version key can be quite out of date from the one present in pyproject.toml after a series of version bumps.

My question for you all is how to best manage this? A couple of solutions I have thought of:

  1. Just ignore this problem out right, and let the version in the uv.lock be out of date. I'm guessing this can lead to complications down the road
  2. Also make bumpver update the uv.lock file manually. Since there is a big disclaimer about not editing the lock file manually, I am hesitant to do this
  3. Regenerate the lock file after I bump the version. This seems to defeat the purpose of using a lock file at all, if I am updating it in CI.
  4. I looked into uv lock --upgrade-package NAME_OF_PROJECT. My hope is it would just update the package information in the lock file, and NOT its dependencies, but I couldn't find any exact information on its behavior.

I know there is an issue to add capabilities for uv to manage versions for you automatically (#6298) but my question is how to manage updating versions in general without this.

@zanieb
Copy link
Member

zanieb commented Sep 24, 2024

Yeah, I think you're looking for uv lock --upgrade-package <project>.

I think @charliermarsh recently fielded a similar question to this.

@charliermarsh
Copy link
Member

We can probably add some docs for this.

@charliermarsh charliermarsh self-assigned this Sep 25, 2024
@charliermarsh charliermarsh added the documentation Improvements or additions to documentation label Sep 25, 2024
@yannsartori
Copy link
Author

Awesome, thanks for the quick reply @zanieb! I'll pursue that solution then. I'll leave this open if you guys want to create the documentation PR off this issue, but my question was answered.

@charliermarsh
Copy link
Member

👍 Thanks for following up. I'll improve the docs a bit and will use this issue to track that work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants