-
Notifications
You must be signed in to change notification settings - Fork 901
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
specify minimum uv version in pyproject.toml #8605
Comments
Just to summarize some of the thinking from the duplicates, more generally we are wanting to set constraints on the version of Aside from a lower bound, I think the most useful constraint would be pinning/equality. I see limited value in upper bounds. Pinning is useful in a CI pipeline to make sure breaking changes in I personally had this situation recently in my organization with the release of v0.5.0 - a whole lot of pipelines failed. Pinning would have prevented this, which is what we're doing now. But now we need a hacky script which re-downloads a hard-coded version of A similar situation exists in regard to pre-commit-uv; you need to pin a version of |
Regarding pinning uv's version, I have a workaround for this. Maybe in the meantime this can help others, so here's how I do it. In my git repository, I track uv's version in the file As for continuous integration, this is how I pin uv's version with GitHub Actions: (...)
jobs:
continuous_integration:
name: Continuous integration
runs-on: ubuntu-24.04
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Fetch uv's version from .uv-version
id: uv-version
run: echo "uv-version=$(cat .uv-version)" >> "$GITHUB_OUTPUT"
- name: Install uv with the version in .uv-version
uses: astral-sh/setup-uv@v3
with:
version: ${{ steps.uv-version.outputs.uv-version }}
enable-cache: true
(...) You can see the whole workflow here. Let me know if something isn't clear. |
Just thinking out loud: What if Users could then run something like |
@sebhoss I think you are describing a way to infer a lower bound based on project file contents. The issue with this is that the intended uv behaviour on a project can be implicit - e.g. we might be relying on a new environment variable provided in the latest version of uv, which earlier versions would ignore. This goes in both directions - there might be a new default incoming in the latest version of uv which I don't want, so I'd want an upper bound to protect from breaking changes. Another similar issue: I think this would require older versions of uv to identify the presence of future versions' features. Perhaps one could use heuristics like unrecognized I think any solution would need to deal with the complexity of actually complying with the bounds (inferred or otherwise)- what should uv do in the situation where uv has the 'wrong' version? Probably there needs to be some uv installation cache to allow switching between uv versions without re-downloading. |
@nathanjmcdougall yeah agreed on all points. I was just a concerned that introducing yet another version might make simple things like switching to a newer python version more annoying than it should be, e.g. consider:
That said, I don't really want to derail the conversation here and I think usability improvements can be made after introducing version constraints for |
I recently noticed that the list of available python versions is hardcoded in uv and thus depends on the version of
uv
used. One of my colleagues was using an older version ofuv
and could not install python 3.13 without updatinguv
first. While updatinguv
is not a problem, I wish that there was a way to specify a minimum required version foruv
itself when working on a project. I think this would improve developer experience because he would immediately have updateduv
instead of debugging why the latest python version cannot be downloaded.The text was updated successfully, but these errors were encountered: