Open chris48s opened 1 month ago
This looks more like a uv pip check
bug. https://pypi.org/project/geojson/#data explicitly declares 3.12 support via the trove classifier and defines the python requirement as >=3.7
This may be the same as https://github.com/astral-sh/uv/issues/7462#issuecomment-2356029053
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 geojson==3.0.0
here for this repro because I was looking for something which has an upper bound constraint. In this case <=3.11
I get that there are a lot of packages out there with a caret constraint on python-requires (e.g: ^3.7
) that implies <4
(perhaps unintentionally) and it can be pragmatic to consider python >=3.7
and python >=3.7, <4
to be "the same", particularly when the project being managed is a package rather than an application.
A few thoughts:
<4
is pragmatic, a package that explicitly declares >=3.7, <=3.11
(for example) should perhaps be considered differently?That said, I'm familiar with the literature :books:
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.