<#20622 python requirement from private package fe...
# github-notifications
c
#20622 python requirement from private package feed using injected PAT Issue created by jfelding In our setup, we have a package in our private package repository (on Azure), which we access with a Personal Access Token like so:
<AZURE_ACCESS_TOKEN>@site.pkgs.visualstudio.com/.../pypi/simple/
However, the PAT is... personal, so we all have a unique one, and we put
AZURE_ACCESS_TOKEN=<token>
in a
.env
file that is of course not committed to git. Now, how do we use this scheme to get our package with pants? It seems we require either: • Dynamically loading
AZURE_ACCESS_TOKEN
from the .env file as an environment variable • Dynamically setting
<AZURE_ACCESS_TOKEN>@developmentsite.pkgs.visualstudio.com/D.../pypi/simple/
as package source By dynamic, I mean that the token is loaded from
.env
at runtime and not set statically in another file that would be comitted to git. We have tried many things but have not succeeded to do this in a way so that we can continue using the standard
pants run ...
CLI. This issue is related to, but different from: #8971 in that we require loading the PAT from the
.env
file. Our workaround In toml we set:
Copy code
[python-repos]
indexes.add = ["<https://feedname:%(env.AZURE_ACCESS_TOKEN)s@site.pkgs.visualstudio.com/.../pypi/simple/>"]
but this requires each user to manually export the environment variable instead of just using the
.env
file. pantsbuild/pants