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

upload: warn the user if their signature(s) are ignored #1010

Merged
merged 3 commits into from Aug 31, 2023

Conversation

woodruffw
Copy link
Member

This is an initial step towards #1009: if twine upload sees that any to-be-uploaded dist has an associated PGP signature and that the index URL looks like pypi.org (i.e. PyPI or TestPyPI), it emits a warning notifying the user that their PGP signature will be silently ignored.

See #1009.

Signed-off-by: William Woodruff <william@yossarian.net>
Still jargon, but hopefully more common jargon.

Signed-off-by: William Woodruff <william@yossarian.net>
@woodruffw woodruffw marked this pull request as ready for review August 27, 2023 20:03
twine/commands/upload.py Fixed Show resolved Hide resolved
Comment on lines 127 to 138
# Warn the user if they're trying to upload a PGP signature to PyPI
# or TestPyPI, which will (as of May 2023) ignore it.
# This check is currently limited to just those indices, since other
# indices may still support PGP signatures.
if (
any(p.gpg_signature for p in packages_to_upload)
and "pypi.org" in repository_url
):
logger.warning(
"One or more packages has an associated PGP signature; "
"these will be silently ignored by the index"
)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NB: I put this in its own little region rather than embedding it in the distribution loop below, under the reasoning that (1) it probably only makes sense to warn once here, and (2) this might get removed eventually anyways, so a less complex diff is better.

Happy to move if you'd prefer it in the loop, though!

Signed-off-by: William Woodruff <william@yossarian.net>
@sigmavirus24
Copy link
Member

Thanks @woodruffw I think one warning (rather than one per artifact) is best for now. I think a second warning for non-PyPI URLs could be useful to indicate we're considering removing support altogether and not just for PyPI uploads (with a link to the issue you opened or some other venue).

@sigmavirus24 sigmavirus24 merged commit 4951945 into pypa:main Aug 31, 2023
20 checks passed
@woodruffw
Copy link
Member Author

Thanks!

I think a second warning for non-PyPI URLs could be useful to indicate we're considering removing support altogether and not just for PyPI uploads (with a link to the issue you opened or some other venue).

Sounds good to me -- I can open a PR for that tomorrow.

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