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

hatch publish --repo pypi dist/* does not work #1905

Open
cnobile2012 opened this issue Feb 5, 2025 · 1 comment
Open

hatch publish --repo pypi dist/* does not work #1905

cnobile2012 opened this issue Feb 5, 2025 · 1 comment

Comments

@cnobile2012
Copy link

cnobile2012 commented Feb 5, 2025

When I run the command above it says there is no https:// or http:// schema on the URL.
I'm using the .pypirc file.
The strange thing is that hatch publish --repo test dist/* works fine.
BTW, there is a schema for both pypi and testpypi before the URL in the .pypirc file.
Also, twine upload --repository pypi dist/* works fine.

$ hatch --version
Hatch, version 1.14.0

@djcopley
Copy link
Contributor

djcopley commented Mar 8, 2025

hatch only references .pypirc to attempt to source the username and password for a repository that it knows about. Use the [publish.index.repos.<REPO>] table to configure available registries.

If the repo name (as configured in the hatch repos table) matches an entry in .pypirc OR the repo url matches any entry in .pypirc, the username and password will be applied. Your test registry is working because the url for testpypi and hatch's default test repository match.

If the URL for your pypi entry in your .pypirc is https://upload.pypi.org/legacy/, use the default hatch publishing repo main (or just omit the --repo all together): hatch publish --repo main dist/*

see: https://hatch.pypa.io/1.12/how-to/publish/repo/

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