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

rye publish -r testpypi uploads to PyPI #871

Open
cjolowicz opened this issue Mar 11, 2024 · 4 comments
Open

rye publish -r testpypi uploads to PyPI #871

cjolowicz opened this issue Mar 11, 2024 · 4 comments

Comments

@cjolowicz
Copy link

Steps to Reproduce

rye init
rye build
rye publish -r testpypi

Expected Result

Rye uploads the package to TestPyPI.

Actual Result

Rye attempts an upload to PyPI.

❯ rye publish -r testpypi
No access token found, generate one at: https://pypi.org/manage/account/token/
Access token: *****
Uploading distributions to https://upload.pypi.org/legacy/
Uploading example-0.1.0-py3-none-any.whl
100% ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 4.5/4.5 kB • 00:00 • ?
WARNING  Error during upload. Retry with the --verbose option for more details.
ERROR    HTTPError: 403 Forbidden from https://upload.pypi.org/legacy/
         Invalid or non-existent authentication information. See https://pypi.org/help/#invalid-auth for more information.
error: failed to publish files

Version Info

❯ rye --version
rye 0.28.0
commit: 0.28.0 (c44dc7ec8 2024-03-07)
platform: macos (aarch64)
self-python: [email protected]
symlink support: true
uv enabled: true

Stacktrace

n/a

@cjolowicz
Copy link
Author

See #741 which may be related?

@chainyo
Copy link

chainyo commented Mar 11, 2024

Hi @cjolowicz, as you saw in the linked issue, you have to provide the repo and the repo url for now.
This should work:

rye publish \
    --repository pypitest \
    --repository-url https://test.pypi.org/simple/ \
    --username $TEST_PYPI_USERNAME \
    --token $TEST_PYPI_PASSWORD \
    --yes

@cjolowicz
Copy link
Author

Thanks @chainyo !

This command worked for me (the upload endpoint is legacy):

rye publish --repository testpypi --repository-url https://test.pypi.org/legacy/

@cnpryer
Copy link
Contributor

cnpryer commented Mar 30, 2024

FWIW in #759 the rework will help us avoid this issue in the future.

Without a credentials file entry, if you don't skip prompts:

❯ rye publish -r testpypi       
Access token: 
Repository URL: 
error: failed to resolve configuration for repository 'testpypi'

If you skip prompts:

❯ rye publish -r testpypi -y
error: failed to resolve configuration for repository 'testpypi'

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

3 participants