check: ignore attestations, like signatures #1172
Merged
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 upload
learned the difference between distributions and attestations, buttwine check
didn't.As a result,
twine check dist/*
would fail withan
InvalidDistribution
error whenever attestations are present in the dist directory, like so: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 #1095, meaning thattwine upload
andtwine check
now have the same input splitting/filtering logic.As part of reusing
_split_inputs
, I moved it to the top-leveltwine.commands
module, 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.