Skip to content

Better error handling for uploading signed files #931

Closed
@jmwoliver

Description

@jmwoliver

With a new user, we ran into an issue where they thought you signed a file by doing:

# Upload the wheel
$ twine upload package.whl

# Then upload the signed file
$ twine upload package.whl.asc

It's not obvious that this is incorrect since trying to upload only the signed file doesn't output anything:

$ twine upload package.whl.asc --verbose
Uploading distributions to https://upload.pypi.org/legacy/
INFO     username set by command options
INFO     password set by command options
INFO     username: __token__
INFO     password: <hidden>

It would be useful to instead output that a signed file must be uploaded with its corresponding distribution:

$ twine upload package.whl.asc --verbose
Uploading distributions to https://upload.pypi.org/legacy/
INFO     username set by command options
INFO     password set by command options
INFO     username: __token__
INFO     password: <hidden>
ERROR    InvalidDistribution: Cannot upload signed file by itself, must upload with its corresponding distribution.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions