Does anyone have a successful setup using `uv` wit...
# general
f
Does anyone have a successful setup using
uv
with a private python repository? I'm having some issues with getting auth to work right. It's working locally, but not in CI, and I can't seem to figure out why. Curious if anyone else has had any hiccups they managed to work through
b
How do you configure auth?
~/.netrc
, credentials embedded in a configured custom index URL or env vars with pass-throughs for those env vars configured in Pants? Or - do you locally use
uv auth
locally? This one does not appear to be handled by Pants.
f
Currently trying to use credentials embedded in the URL. I had it configured this way for a while now (prior to trying to switch to uv). My naiive attempt was "maybe it will just work the same way", but then it worked locally and not in CI
Not opposed to trying a different auth strategy (hence the curiosity if someone has a way that seems to be working well)
b
So - be really verbose! Is the auth in the URL embedded directly or via env var?
https://exactly:this@example.org vs.
https://${SNEAKY}@example.org
Or ... some other incantation. Also, what fails in CI, lock file generation or lock file use (building PEXes from uv venvs)
f
auth is embedded via env var like
https://${USER}:${PASSWORD}@example.org
I don't generate the lock file at all in CI. Its on use (and on any use) that it fails. It is always due to a 401 return from artifactory when trying to access the internal package. I turned on verbose logging and that was enough to see that it got the 401 from
<https://example.org>
I notice the URL no longer contains the auth. I don't know if that is due to it being lost in translation, or if uv just stripped it from the log.
b
And how do you get pants to plumb USER and PASSWORD - are there additional setting you use to punch holes for these env vars?
So so verbose please. All relevants
All I can imagine is you get away with things locally due to credentials cached by uv via
uv auth
and right here Pants fails to set up full indexes / find-links for venv creation like it does for lock creation: github.com/pantsbuild/pants/blob/…/uv.py#…
Aha - that was it:, just got fixed: github.com/pantsbuild/pants/blob/…/uv.py#… Unrelated commit though apparently: github.com/pantsbuild/pants/commit/e2d3b7d7b4d4… That said, the fix is partial - it appears to still ignore find-links, which presumably would still have this issue if authed http find-links repos.
f
Looks like I just need the next 2.34 release then. Thanks for the info
h
Related issue: https://github.com/pantsbuild/pants/issues/23459 And I will fix the find-links issue I think by folding them into indexes with
format = "flat"