check: ignore attestations, like signatures#1172
Merged
sigmavirus24 merged 1 commit intopypa:mainfrom Oct 31, 2024
Merged
Conversation
This fixes a bug that I accidentally introduced with
attestations support: `twine upload` learned the difference
between distributions and attestations, but `twine check`
didn't.
As a result, `twine check dist/*` would fail with
an `InvalidDistribution` error whenever attestations are
present in the dist directory, like so:
```
Checking dist/svgcheck-0.9.0.tar.gz: PASSED
Checking dist/svgcheck-0.9.0.tar.gz.publish.attestation: ERROR InvalidDistribution: Unknown distribution format:
'svgcheck-0.9.0.tar.gz.publish.attestation'
```
This fixes the behavior of `twine check` by having it
skip attestations in the input list, like it does with
`.asc` signatures. To do this, I reused the `_split_inputs`
helper that was added with pypa#1095, meaning that `twine upload`
and `twine check` now have the same input splitting/filtering
logic.
See pypa/gh-action-pypi-publish#283
for some additional breakage context.
Signed-off-by: William Woodruff <[email protected]>
sigmavirus24
approved these changes
Oct 31, 2024
Member
|
@sigmavirus24 @jaraco any chance to release this ASAP? With the last |
This was referenced Nov 30, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This fixes a bug that I accidentally introduced with attestations support:
twine uploadlearned the difference between distributions and attestations, buttwine checkdidn't.As a result,
twine check dist/*would fail withan
InvalidDistributionerror whenever attestations are present in the dist directory, like so:This fixes the behavior of
twine checkby having it skip attestations in the input list, like it does with.ascsignatures. To do this, I reused the_split_inputshelper that was added with #1095, meaning thattwine uploadandtwine checknow have the same input splitting/filtering logic.As part of reusing
_split_inputs, I moved it to the top-leveltwine.commandsmodule, since that's where other shared input handling helpers live. I've also moved the test to match.See pypa/gh-action-pypi-publish#283 for some additional breakage context.