chaquo / chaquopy

Chaquopy: the Python SDK for Android
https://chaquo.com/chaquopy/
MIT License
807 stars 132 forks source link

Issue pulling packages from Google Artifact Registry (GAR) #1046

Closed rek closed 9 months ago

rek commented 9 months ago

I'm trying to install a whl file from a private GAR by adding this to my build.gradle:

options "--extra-index-url", "https://xxx.pkg.dev/xxx/simple/"

But i'm getting stuck with the error:

...pip/_internal/network/auth.py", line 218, in _prompt_for_password

It seems to not pickup my env credentials and trying to login the default way.

I have confirmed my normal pip env setup is ok, but i'm guessing my struggle is getting gradle to know that?

Normally i do this in CI/CD, following the GAR docs:

....setup-gcloud...

pip install keyring
pip install keyrings.google-artifactregistry-auth
pip config set global.extra-index-url https://xxx.pkg.dev/xxx/simple/

pip install some_private_whl

and everything is fine.

Any suggestions how to integrate the service account gcloud is using with my build?

rek commented 9 months ago

Ok nevermind, I spoke to soon, you can just make a key for your service account and use the 'less recommended' format:

https://_json_key_base64:BASE64_KEY@LOCATION-python.pkg.dev/PROJECT/REPOSITORY/simple/