helpful-rocket-63313
10/31/2023, 7:02 PMkeyrings
to authenticate to GAR's https://cloud.google.com/artifact-registry/docs/python/store-python#configure However pants doesn't support keyring. I also tried. adding keyring
to PATH
but that didn't work. i have another workaround though,
[python-repos]
indexes.add = [
"<https://oauth2accesstoken>:%(env.GOOGLE_ACCESS_TOKEN)s@us-central1-python.pkg.dev/<project>/<repository>/simple",
]
however it needs google auth token, and the way i can generate these token is gcloud auth print-access-token
which have a ttl of 5min(or so).
So currently i have to run all pants related commands like GOOGLE_ACCESS_TOKEN="$(gcloud auth print-access-token)" pants check ::
or GOOGLE_ACCESS_TOKEN="$(gcloud auth print-access-token)" pants generate-lockfiles
.
is it possible to have this GOOGLE_ACCESS_TOKEN
also computed dynamically by pants
itself ? maybe by definiting this as an alias
?curved-television-6568
10/31/2023, 7:11 PM.pants.bootstrap
script:
export GOOGLE_ACCESS_TOKEN="$(gcloud auth print-access-token)"
helpful-rocket-63313
10/31/2023, 7:38 PM.pants.bootstrap
. ? I see python-bootstrap
but not .pants.bootstrap
curved-television-6568
10/31/2023, 7:41 PMhelpful-rocket-63313
10/31/2023, 7:42 PM