Hi team. I am looking at this documentation <https...
# general
g
Hi team. I am looking at this documentation https://www.pantsbuild.org/docs/python-third-party-dependencies#custom-repositories I have a custom pypi repo that need authentication. how can I config the user name and password for this custom repo?
h
Would like to bump this. I'm going to have a similar issue in the future.
g
anyone can help on this?
h
This isn't available in 2.11, but in Pants 2.12 (an alpha release of which is available now at version 2.12.0a0) you can interpolate environment variables in your config files. So you can, for example, use
http://%(env.USERNAME)s:%(env.PASSWORD)s@my.custom.repo/index
or whatever and set USERNAME/PASSWORD in the Pants process's environment before running it
👍 1
In 2.11 or earlier, you can use Pants's existing support for setting config via env vars:
PANTS_PYTHON_REPOS_INDEXES='+["http://$USERNAME:$PASSWORD@my.custom.repo/index"]'
h
or set up a
,pants.rc
file where you hardcode the files: https://www.pantsbuild.org/docs/options#pantsrc-file
h
I will add this to the docs at that URL
🙌 1
g
@happy-kitchen-89482 if I understand correctly, for 2.11 or early, I cannot do it in pants.toml file. in 2.12, we can start using in toml file? in 2.11 or early, I can use this pattern
Copy code
PANTS_PYTHON_REPOS_INDEXES="...." ./pants
h
correct, specifically the
env
interpolation is new to 2.12
👍 1
h