-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Slow resolution from Azure DevOps feed #11379
Comments
When resolving, uv needs the metadata of every version used in the resolution. This information we get from a file called The hint is in this log message:
|
Thank you so much for this quick response, this makes perfect sense. I’m contacting those responsible for adding support for this. I’m closing this, but any pointers or advice for adding support for this sort of thing to a tracker is very much appreciated! I’m very pro not spending unnecessary energy boiling the oceans, especially in a CI! |
Reopening this because I have some new information and am trying to find a minimum repro. Full disclosure: I actually work at Microsoft, but as a Data Scientist and not affiliated with the Azure teams. My opinions are my own. I raised this internally within Microsoft, and learnt that we do not support PEP 658 yet, but we do support HTTP range requests. However, we think that My intention is now to see if we can work out why uv doesn't handle the redirect for HTTP range requests. I have created a public tracker on Azure DevOps (ADO) where I can add specific python packages from PyPI to make them available to the public on that tracker. I have added PyPI as an "upstream provider", which lets an authenticated user to the ADO project (me) add any PyPI package version to the feed for public consumption. I do that via
I've run the above a few times now, and always get at least one package warning, sometimes two or three: ❯ export INDEX='https://pkgs.dev.azure.com/thomasaarholt/thomasaarholt-python/_packaging/thomas-python-feed/pypi/simple/'
uv venv --seed --quiet
source .venv/bin/activate.fish
uv pip install numpy pandas scikit-learn --index-url=$INDEX --no-cache -v &| grep stream # I pipe stdout and stderr into grep
# WARN Range requests not supported for scikit_learn-1.6.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl; streaming wheel
# rerun
❯ export INDEX='https://pkgs.dev.azure.com/thomasaarholt/thomasaarholt-python/_packaging/thomas-python-feed/pypi/simple/'
uv venv --seed --quiet
source .venv/bin/activate.fish
uv pip install numpy pandas scikit-learn --index-url=$INDEX --no-cache -v &| grep stream # I pipe stdout and stderr into grep
# WARN Range requests not supported for pandas-2.2.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl; streaming wheel
# WARN Range requests not supported for scikit_learn-1.6.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl; streaming wheel
# WARN Range requests not supported for numpy-2.2.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl; streaming wheel Is there any chance I could get some help debugging this from the uv team? |
I'm not seeing the opt-in to using the keyring and a username in the index URL. On the range requests... Is it feasible to create a simple nginx container or something that replicates the setup? Can you reproduce with async_http_range_reader directly? cc @konstin I think you have some familiarity with |
Yes, I'm showing the regular index url here since the user shouldn't need authentication when installing packages that are on the feed. When trying to get uv to authenticate to add packages from PyPI to my public feed, I was using:
Here's the log for that in a gist. To clear one possible point of confusion: One must be an authenticated user in order to install an upstream (PyPI) package through an ADO feed. This is by design (purple box).
I might be able to. Never worked with nginx before, and only a bit with rust. I will try if I can find the time. |
So a range request does work with
|
But... if you make a HEAD request, the index returns a HTTP 405 method not allowed
which is what we use to determine if range requests are supported uv/crates/uv-client/src/registry_client.rs Lines 711 to 753 in 748582e
https://github.com/prefix-dev/async_http_range_reader/blob/c2a1b5a63712a34bca661cc94389fb03fb0dcddd/src/lib.rs#L310-L318 |
I would be curious to hear why they don't support HEAD requests — as that seems to be the crux of the problem here. You could set |
That was quick! I've brought it up internally now. Thank you! |
For additional context, we should be following redirects in the HEAD request, but we need the initial HEAD requests to determine whether the server supports range requests (https://github.com/prefix-dev/async_http_range_reader/blob/9c1e2d3082745f3a75d8065a3dd145cd51b2715a/src/lib.rs#L310-L318). |
✅
|
Summary
Hi!
I'm trying to find the best way to debug why installing from my work's package index is so slow. The dependency resolution is the slow part, at 25 sec for our index vs 0.3 sec for pypi.
I have followed the uv instructions for alternative package indexes. We mostly mirror pypi, and for these packages I don't expect there to be any real difference, except that it should be a bit faster since we probably host fewer packages.
There is no authentication window that I need to click on, everything happens automatically. We've added keyring to uv tool with
uv tool install keyring --with artifacts-keyring
.Summary logs
Verbose logs
I include full logs when appending --verbose to the calls for the pypi and other index-url case.
Platform
Windows 11 x86_64
Version
uv 0.5.25 (9c07c3f 2025-01-28)
Python version
3.12.8
The text was updated successfully, but these errors were encountered: