Repository navigation
Description
#20790 supports proxy indexes when the upstream and proxy artifact URLs differ only by a prefix. Artifactory and Google Artifact Registry serve the same files as PyPI under different paths, so a prefix swap can produce a URL that returns 404. This issue tracks mapping those URLs in both directions. Specifically:
- Installing from a lock: Given a canonical URL in uv.lock, find the corresponding artifact on the configured proxy and verify it against the locked hash.
- Creating or updating a lock: When resolution selects an artifact through the proxy, write the real canonical URL and artifact hash to uv.lock so the same lock also works without the proxy.
Some environments can only reach the proxy, even when locking. PyPI’s content-addressed paths give us a way to derive the canonical URL in that case. For upstream indexes with opaque paths, where that URL comes from is an open question.
Original request by @rakhimovv below:
Artifactory's PyPI repositories serve files under <name>/<version>/<file>, not PyPI's hashed directories. The simple page for six already shows it:
PyPI: https://files.pythonhosted.org/packages/b7/ce/149a00dd41f10bc29e5921b496af8b574d8413afcd5e30dfa0ed46c2cc5e/six-1.17.0-py2.py3-none-any.whl#sha256=4721f391…
Artifactory: <base>/api/pypi/<repo>/simple/six/ → ../../packages/packages/six/1.17.0/six-1.17.0-py2.py3-none-any.whl#sha256=4721f391…
Same sha256. The PyPI-shaped path under the Artifactory base returns 404 (I tried api/pypi/<repo>/packages/…, api/pypi/<repo>/… and <repo>/…), so no artifact-base-url makes the prefix swap round-trip:
[[proxy-index]]
name = "artifactory"
url = "https://<host>/artifactory/api/pypi/<repo>/simple/"
artifact-base-url = "https://<host>/artifactory/api/pypi/<repo>/packages/" # → packages/six/1.17.0/…, not packages/b7/ce/…
proxy-for = "pypi"I haven't run this against main (no release has proxy-index yet). From the docs and the GAR report I expect the same result: uv lock records upstream URLs that don't exist.
What would make it work for us is an opt-in, per-proxy mode for installs from the lock: look up the locked filename in the proxy's simple index for that package and check the locked hash, instead of swapping prefixes. It costs one index request per package (the GAR report measured about 5 s for a 235-package lock without PEP 658/691), so it should stay off by default. It covers only installs. Locking through such a proxy would still need the upstream URL from somewhere, and I'd be glad to hear whether that half is in scope.
Activity
zsol commentedon Nov 19, 2026
Yes you're correct that current
maindoes not support this yet, and is planned as a followup (I'm starting work on it soon). Thanks for opening this issue. I've added some context at the top.