When pants needs to install a package with pip, is...
# general
h
When pants needs to install a package with pip, is there any way to get it to look at a local
pip.conf
file? I'll admit I haven't tried this to see what happens yet.
f
when I've tried this a year ago it didn't work, and I had to use https://www.pantsbuild.org/v2.13/docs/reference-python-repos
I don't think it works now either. Which makes sense because authentication against custom PyPI servers can happen via multiple ways (pip.conf file, netrc file etc)
h
Right, the constraint I'm working with seems like it would be fine outside of pants since the package installer would be
pip
and pip knows how to look for
pip.conf
and I can place secrets in the urls for our developers in those local files. Not great, but at least workable.
But I have a feeling Pants might make that not feasible if it's using a pip installed inside its cache
Trying to browse the code, it kind of seems like it uses the system's pip? I don't see it explicitly being pulled
Looks like you can have a
.pants.rc
file to do this
which is less desirable as pointed out by https://github.com/pantsbuild/pants/issues/14928
w
Trying to browse the code, it kind of seems like it uses the system’s pip? I don’t see it explicitly being pulled
PEX
vendors
pip
(don’t know about the rest though: sorry!)
f
fwiw,
PANTS_PYTHON_REPOS_INDEXES
env var can be defined, e.g.
"+['<https://user:key@server/pypi/pypi/simple>']"
and how you get your
user
and
key
is up to you, i.e. you can retrieve it from your keyring or Vault or anything
that’s how we approach it in the CI