cool-easter-32542
02/27/2024, 9:15 AM<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:
[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/pantscool-easter-32542
02/27/2024, 12:01 PM