-
-
Notifications
You must be signed in to change notification settings - Fork 307
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Google Artifacts repository support #713
Comments
Well it seems I have found a solution:
However this feels like a workaround. Any other suggestions for utilizing keyrings.google-artifactregistry-auth? |
Thank you for the reply. I may be missing something, but I can't understand how these links you provided help with setting up the Google's keyring authentication. |
Sorry I haven't had much time to look into this. What kind of solution or configuration are you expecting? |
Yeah looking for the same would like to use keyring keyrings.google-artifactregistry-auth |
Ok hatch does not use the user returned from the keyring when keyrings.google-artifactregistry-auth is used. A workaround is to pass the user it returns which is so the hatch publish call would look something like
|
Sorry for the delay.
I expected that the behaviour would be similar to twine. For twine, a simple as per @owenhaynes hatch doesn't seem to be using that info from keyrings so it requires additional config. Although there are two workarounds in this very thread, user experience would be greatly increased if |
I like this more as I don't have to manually base64 encode the SA |
@InCogNiTo124 do you know how to get hatch to pull dependencies from private indexes using the keyring or is this a missing feature? |
@owenhaynes haven't yet had the chance to test it out |
Looks like you need to have the env |
Hello! I would like to better support this use case. Can one of you write down an enumeration of the current issues and a potential remedy? |
ContextWe use GAR to publish private Python packages. The CI does it for us. This is an example of a typical GitHub CI: twine CI examplejobs:
build-and-publish:
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
- uses: google-github-actions/auth@v1
with:
credentials_json: <some json key>
- ... other steps ...
- run: python3 -m build
- run: python3 -m pip install keyring keyrings.google-artifactregistry-auth
- run: python3 -m twine upload --repository-url https://europe-python.pkg.dev/my-gcp-project/foo/ dist/* Twine uses Problem statementSimply switching Possible explanationsIt seems that hatch doesn't use all the data from the keyring as twine does. For example: https://github.com/pypa/twine/blob/9ac14fcb68b3ff06eb2c0056a4006c2ea6a1aa10/twine/auth.py#L55,L67 vs Possible solutionsI guess hatch should introduce keyring probing for usernames as well, not just for passwords. I don't know myself how would I incorporate this change in the codebase. |
@ofek any update on this? |
I am trying to solve this problem~ |
I contributed the |
Resolved (I think) by #836 |
Hey,
I'm trying to use hatch to upload packages to GAR.
GAR uses keyrings and google auth keyring. Twine seems to be using them correctly as
twine upload
works, but I can't set hatch to use them. Any ideas?The text was updated successfully, but these errors were encountered: