Can uv.lock
contain multiple source registries for a single package?
#7700
Labels
enhancement
New feature or request
I've been experimenting a bit with
uv lock
and came across a use-case that I can't seem to resolve.My project is developed on python 3.10/3.11/3.12, and I have a dependency on a package that only has wheel distributions in pypi.org for 3.10 and 3.11, but not for 3.12. So when installing the package on 3.12 it has to be built from source distribution, which takes a very long time (~10 minutes).
Eventually the build succeeds and my code works fine with this version, but I want to speed up my CI, so I looked up in
uv cache dir
, found the wheel, and thenuv publish
ed it to my private pypi index.The problem is that now when I
uv lock
(with--index-strategy=unsafe-best-match
and--extra-index-url=<my_private_index_url>
), the generateduv.lock
file only lists the wheels from my private index, without the rest of the wheels from pypi.org.This is a an example for my
pyproject.toml
before adding my private index and wheel:And this is the
[[package]]
section forpandas
inuv.lock
after runninguv lock
:As you can see - there are no wheels listed for python 3.12.
Now this is my modified
pyproject.toml
after building a wheel forpandas==1.5.3
on python 3.12 and publishing it to my private pypi index:And this is the
[[package]]
section forpandas
inuv.lock
after runninguv lock
:As you can see:
source
registry which is my private index.sdist
because I didn't publish the source distribution to my private index.wheel
listed - the one from my private index.Currently my workaround for this is to download all the other wheels and sdist from the original lock file and publish them to my private repo, but that seems like a very brittle solution:
TL;DR - Can the
source
entry in the[[pacakge]]
part of theuv.lock
file support more than oneregistry
?Ran all of these examples with
uv==0.4.16
The text was updated successfully, but these errors were encountered: