-
Notifications
You must be signed in to change notification settings - Fork 640
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
UV will add and install packages that are not compatible with current python version #7869
Comments
This looks more like a |
This may be the same as #7462 (comment) |
In this case, geojson doesn't define an upper bound |
You're right! I was looking at the latest pypi release and the upper bound got removed there. But 3.0.0 still has it. |
Yes. Note I picked explicitly I get that there are a lot of packages out there with a caret constraint on python-requires (e.g: A few thoughts:
That said, I'm familiar with the literature 📚
etc |
First off, apologies if this has already been reported. I did have a look over the tracker and could not find a similar issue. I am using
uv==0.4.18
. The problem I have hit is that uv will silently add and install packages that are not compatible with the project's python version without throwing an error.So for example, if I have a project that uses python 3.12 I can
uv add geojson==3.0.0
(this package isn't compatible with python 3.12) without error. I can run manually runuv pip check
after installing and that will tell me that(or whatever) but in my opinion, trying to
uv add
,uv lock
,uv sync
etc should throw a hard error if I try to add/lock/sync packages that are not compatible with the project python version. The behaviour should be similar to the "No solution found when resolving dependencies" error seen when trying to install 2 incompatible packages.To demonstrate the problem, I have a made a small repo at https://github.com/chris48s/uv-repro with a minimal UV/python 3.12 in it and a GitHub Actions Workflow that demonstrates the issue https://github.com/chris48s/uv-repro/blob/main/.github/workflows/build.yml
Here's a link to a build: https://github.com/chris48s/uv-repro/actions/runs/11146126874/job/30977334223
If you can't see the individual outputs of the workflow steps, you can fork or copy the repo, push it up and run it yourself to get a repro you can inspect. That said, it should hopefully be pretty easy to reproduce locally.
The text was updated successfully, but these errors were encountered: