Skip to content

Twine check fails to warn on invalid classifier #976

Open
@pombredanne

Description

@pombredanne

Your Environment

Using twine:

$ twine --version
twine version 4.0.2 (importlib-metadata: 6.0.0, keyring: 23.13.1, pkginfo: 1.9.6, requests:
2.28.1, requests-toolbelt: 0.10.1, urllib3: 1.26.13)

I have a setup.cfg with this classifier:
Development Status :: 4 - Beta
there is an extra space before the 4

If I build a wheel and run twine check, it passes (see attached wheel where the .zip extension has been added to make this tracker happy)
tracecode_toolkit_strace-0.21.0-py3-none-any.whl.zip

$ twine check dist/tracecode_toolkit_strace-0.21.0-py3-none-any.whl --strict
Checking dist/tracecode_toolkit_strace-0.21.0-py3-none-any.whl: PASSED

If I try to upload this to PyPI I get this error:

$ twine upload dist/tracecode_toolkit_strace-0.21.0-py3-none-any.whl 
Uploading distributions to https://upload.pypi.org/legacy/
Uploading tracecode_toolkit_strace-0.21.0-py3-none-any.whl
100% ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 97.6/97.6 kB • 00:00 • 458.3 kB/s
WARNING  Error during upload. Retry with the --verbose option for more details.                     
ERROR    HTTPError: 400 Bad Request from https://upload.pypi.org/legacy/                            
         Invalid value for classifiers. Error: Classifier 'Development Status ::  4 - Beta' is not a
         valid classifier.                           

I would expect the check to fail if the upload would fail.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions