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

Updating pyproject.toml version during build results in incorrect version in uv.lock #7994

Open
david-waterworth opened this issue Oct 8, 2024 · 3 comments
Assignees

Comments

@david-waterworth
Copy link

This is more an observation rather than an issue.

I'm using a ci tool that parses commit history, generates the "next" version and updates the version in pyproject.toml (the tool is python-semantic-release).

What I just noticed was, since python-semantic-release updates pyproject.toml when it performs a build, once the build has finished uv.lock contains the "wrong" version for the project, i.e.

[[package]]
name = "my-package"
version = "0.2.1.dev0"
source = { virtual = "." }

Since python-semantic-release bumped the version to "0.2.1". To fix I added uv sync && build.sh && git add uv.lock - this updates the lock file and stages it (with the other files python-semantic-release modifies.

I'm not sure if this causes more problems than it fixes, but I thought I'd mention it - I think in general it's probably a better practice to generate tags based on the pyproject.toml->project.version rather than the other way around?

@zanieb
Copy link
Member

zanieb commented Oct 8, 2024

Thanks for the report.

I think @charliermarsh has some context on this.

@my1e5
Copy link
Contributor

my1e5 commented Oct 8, 2024

Related: #7533

@david-waterworth
Copy link
Author

@my1e5 yeah that's the same - shall I close this?

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

No branches or pull requests

4 participants