Skip to content
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

Unable to publish package to Google Artifact Registry #9778

Open
joaodaher opened this issue Dec 10, 2024 · 1 comment
Open

Unable to publish package to Google Artifact Registry #9778

joaodaher opened this issue Dec 10, 2024 · 1 comment

Comments

@joaodaher
Copy link

joaodaher commented Dec 10, 2024

We're currently migrating from Poetry to uv.
We use Google Artifact Registry as our private PyPI server.

I was able to download private packages using uv with the pyproject.toml config:

[[tool.uv.index]]
name = "private-pypi"
url = "https://[email protected]/nilo-prd/python-nilo/simple/"

[tool.uv.sources]
our-private-lib = { index = "private-pypi" }

But I cannot publish/upload any private package.

I'm using:
uv publish --keyring-provider subprocess --username __token__ --publish-url https://us-east1-python.pkg.dev/nilo-prd/python-libs/

And I get the output (when verbose) followed by a stuck execution:

DEBUG Checking keyring for credentials for __token__@https://us-east1-python.pkg.dev/nilo-prd/python-libs/
DEBUG Found credentials in keyring for https://us-east1-python.pkg.dev/nilo-prd/python-libs/
DEBUG Response code for https://us-east1-python.pkg.dev/nilo-prd/python-libs/: 401 Unauthorized

With twine I can execute:

twine upload --repository-url https://us-east1-python.pkg.dev/nilo-dev/python-libs/ dist/*

And successfully publish the package. So the keyring seems to be working fine.

Any idea of what I'm missing here?

@thejosephstevens
Copy link

Unfortunately I'm in the same boat, but I'd like to see a solution here (super excited to see #7839 !) . I've tried both of the documented solutions here and have not been able to get either of them to work. The same twine upload command works just fine for us (that's what we've been using with rye). I have never been able to get anything other than a 401 or 404 with uv publish. What I've run into:

  • If I set keyring provider to subprocess I get a 404 and the command never returns (same as above)
  • If I have oauth2accesstoken@ in the publish url I get a failure due to redirect on publishing. The error instructs me to use the canonical url
  • If I pass oauth2accesstoken and the token in basic auth in the publish url, I get prompted for username/password
  • If I use the canonical url (with /simple) and I explicitly pass in the token, I get a 404 and the command never returns.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants