-
Notifications
You must be signed in to change notification settings - Fork 772
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
Publish: Docs for using the keyring #8806
base: main
Are you sure you want to change the base?
Conversation
While publishing from CI is clearly the better choice, for smaller projects it may just not be worth the effort, so we also support publishing from a local machine. We don't support `.pypirc`, the non-standard file that saves password as plaintext to the user home. Instead, we recommend using the keyring for local publishing, using the operating system's much more secure, mostly standardized and better queryable credential store as backend. This comes with the catch that the keyring keys by URL+username, so we need to use the horrible query string attach to tag per-project scoped tokens to a more specific URL (pypa/twine#565).
Co-authored-by: Jo <[email protected]>
Co-authored-by: Jo <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Given that the ?PACKAGE_NAME
suffix is a hack, I think it would also be beneficial to include in this guide the fact that you can have a single token for all publish URLs, and adding the hack is only an optional security precaution that allows you to have different tokens for different packages. I would suggest also including a section that says something like:
If you don't need the added security of scoping tokens to single packages, and instead use one token for all packages, you can use the following:
keyring set 'https://upload.pypi.org/legacy/' __token__Then you can publish with:
uv publish --username __token__ --keyring-provider subprocess --publish-url 'https://upload.pypi.org/legacy/'
Not to open up another can of worms, but what makes something standard or not? the |
|
Personally, I find it misleading that I'm focussing the guide on security best practices, such as using the keyring with least-privileged tokens. |
Closes #29 thanks to the help of documentation in astral-sh/uv#7963 and astral-sh/uv#8806
While publishing from CI is clearly the better choice, for smaller projects it may just not be worth the effort, so we also support publishing from a local machine.
We don't support
.pypirc
, the non-standard file that saves password as plaintext to the user home. Instead, we recommend using the keyring for local publishing, using the operating system's much more secure, mostly standardized and better queryable credential store as backend. This comes with the catch that the keyring keys by URL+username, so we need to use the horrible query string attach to tag per-project scoped tokens to a more specific URL (pypa/twine#565).Fixes #7963