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

Support retrieving name and repo-url from credentials if not provided #217

Merged
merged 4 commits into from May 27, 2023

Conversation

ischaojie
Copy link
Contributor

@ischaojie ischaojie commented May 26, 2023

Add the ability to automatically get the repository-url and username from the credentials configuration.

If repository-url or username is either not provided, try to get it from the credentials configuration, or provide the default value if it is not available.

Then, you just need to execute rye publish -r testpypi each time.

A simple test:

➜  o git:(main) ✗ rye publish -r testpypi
Uploading distributions to https://test.pypi.org/legacy/
Uploading o-0.1.0-py3-none-any.whl
100% ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 3.6/3.6 kB • 00:00 • ?
WARNING  Error during upload. Retry with the --verbose option for more details.
ERROR    HTTPError: 400 Bad Request from https://test.pypi.org/legacy/
         The name 'o' is too similar to an existing project. See https://test.pypi.org/help/#project-name for more information.
Error: failed to publish files
➜  o git:(main) ✗ cat ~/.rye/credentials
[pypi]
token = "......"
repository-url = "https://upload.pypi.org/legacy/"
username = "__token__"

[testpypi]
token = "......"
repository-url = "https://test.pypi.org/legacy/"
username = "__token__"

@mitsuhiko mitsuhiko merged commit a6ea353 into astral-sh:main May 27, 2023
6 checks passed
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

Successfully merging this pull request may close these issues.

None yet

2 participants