rich-church-77699
09/20/2021, 1:03 PMPyPi mirror hosted on AWS CodeArtifact that requires a username and token to access.
Is there any configuration in Pants that will allows us to inject the PyPi token for Pants to use, or make it use pip.conf which is setup with the username and token for the PyPi mirror.enough-analyst-54434
09/20/2021, 3:44 PMPANTS_PYTHON_REPOS_INDEXES='["<https://user:token@host/...|https://user:token@host/...>"]'. That's just leveraging generic support for setting Pants option via PANTS_ env vars to configure the python-repos subsystem: https://www.pantsbuild.org/docs/reference-python-reposenough-analyst-54434
09/20/2021, 6:17 PMpants.toml - that doesn't really make things much better, it just means the user:pass could be exposed as env vars / interpolated as atoms instead of the whole URL as with the PANTS_PYTHON_REPOS_INDEXES approach. The other is to support flags specified in requirements files. That's also not much better, since it really amounts to the pants.toml interpolation since Pip requirements files also support env var interpolation. The option we haven't pursued or thought about is directly supporting pip.conf. Right now, our resolver - Pex - does use Pip under the hood, but it explicitly turns off ambient Pip env var and file base configuration with --isolated . I'm not sure of the implications of turning off that flag, but even if they are undesirable, Pex or Pants could also gain support for parsing pip.conf for sensitive configuration values and then manually plumbing those through.rich-church-77699
09/21/2021, 1:52 PMPoetry which I was using to generate a constraints.txt which it was adding in --extra-index into the file pointing to our private PyPi.
So have to remove that line, and with PANTS_PYTHON_REPOS_INDEXES it worked.
Managing credentials has always been a little bit messy with Pip.enough-analyst-54434
09/21/2021, 2:11 PM