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

twine check should validate Description-Content-Type #589

Closed
twm opened this issue Apr 17, 2020 · 3 comments
Closed

twine check should validate Description-Content-Type #589

twm opened this issue Apr 17, 2020 · 3 comments
Labels
blocked Issues we can't or shouldn't get to yet duplicate

Comments

@twm
Copy link

twm commented Apr 17, 2020

Your Environment

  1. Your operating system: Ubuntu 18.04

  2. Version of python you are running: Python 3.7.7 (distro version)

  3. How did you install twine? Did you use your operating system's package manager or pip or something else?

pipx (so pip)

  1. Version of twine you have installed (include complete output of):
twine version 3.1.1 (pkginfo: 1.5.0.1, requests: 2.23.0, setuptools: 46.0.0,
requests-toolbelt: 0.9.1, tqdm: 4.43.0)
  1. Which package repository are you targeting? pypi.org

The Issue

twine check doesn't validate Description-Content-Type / long_description_content_type.

Steps to Reproduce

I added Description-Content-Type metadata because twine check warned me it was missing, but I made a typo: it is test/x-rst, (test vs. text).

I ran twine check on the packages with this metadata:

twine check dist/*.*
Checking dist/treq-20.3.0.tar.gz: PASSED
Checking dist/treq-20.4.0.tar.gz: PASSED

However, when I went to upload to PyPI:

twine upload dist/treq-20.4.0*
Uploading distributions to https://upload.pypi.org/legacy/
Enter your username: twm
Enter your password: 
Uploading treq-20.4.0-py2.py3-none-any.whl
100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 62.2k/62.2k [00:01<00:00, 44.6kB/s]
NOTE: Try --verbose to see response content.
HTTPError: 400 Client Error: 'test/x-rst' is an invalid value for Description-Content-Type. Error: Invalid description content type: type/subtype is not valid See https://packaging.python.org/specifications/core-metadata for url: https://upload.pypi.org/legacy/

The artifacts are attached here: https://github.com/twisted/treq/releases/tag/release-20.4.0

@di
Copy link
Member

di commented Apr 17, 2020

Ultimately I think this is a duplicate of #430 and will be resolved when we begin validating all the metadata.

@bhrutledge bhrutledge added the blocked Issues we can't or shouldn't get to yet label Apr 18, 2020
@bhrutledge
Copy link
Contributor

@di I've labeled this is blocked, unless you think it's preferable to close it as a duplicate.

@bhrutledge
Copy link
Contributor

After doing some triage, going to close this as a duplicate of #430.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked Issues we can't or shouldn't get to yet duplicate
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants