openpreserve / jpylyzer

JP2 (JPEG 2000 Part 1) validator and properties extractor. Jpylyzer was specifically created to check that a JP2 file really conforms to the format's specifications. Additionally jpylyzer is able to extract technical characteristics.
http://jpylyzer.openpreservation.org/
Other
69 stars 28 forks source link

Twine ignores long_description_content_type in setup.py #152

Closed bitsgalore closed 4 years ago

bitsgalore commented 4 years ago

Trying to make the PyPi packages by running:

sudo ./package-pypi.sh

Result:

HTTPError: 400 Client Error: The description failed to render in the default format of
reStructuredText. See https://pypi.org/help/#description-content-type for more information.
for url: https://upload.pypi.org/legacy/

This indicates a problem with long_description in setup.py. So following the info in that link (https://pypi.org/help/#description-content-type), installed the readme_renderer, the latest twine version, and then:

  1. build the package:

    sudo python setup.py bdist_wheel --universal

  2. test it:

    ~/.local/bin/twine check dist/*

Result:

Warning: Old version of cryptography ([1, 2, 3]) may cause slowdown.
  warnings.warn(warning, RequestsDependencyWarning)
Checking dist/jpylyzer-2.0.0rc1-py2.py3-none-any.whl: FAILED
  `long_description` has syntax errors in markup and would not be rendered on PyPI.
    line 58: Warning: Inline emphasis start-string without end-string.
  warning: `long_description_content_type` missing.  defaulting to `text/x-rst`

So even though long_description_content_type in setup.py is set to 'text/markdown', for some reason twine does not understand this, assumes restructured text (which it uses as a default) and then rejects the upload.

carlwilson commented 4 years ago

@bitsgalore it's the twine version: https://github.com/pypa/twine/issues/454

bitsgalore commented 4 years ago

As a workaround I commented out long_description and long_description_content_type from setup.py, ugly but at least this allows us to distribute the package:

https://github.com/openpreserve/jpylyzer/commit/1f4e90ca82bad54aff25de256d4bee1d29209d17

carlwilson commented 4 years ago

@bitsgalore I'd thought about suggesting that....

bitsgalore commented 4 years ago

Closing because Dockerizing fixes this.