Twine: "twine check" is emitting a UserWarning when executed because it's misusing readme_renderer

Created on 28 Oct 2018  路  2Comments  路  Source: pypa/twine

1) Your operating system:

macOS 10.14

2) Version of python you are running:

3.7.0

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

pip

4) Version of twine you have installed (include complete output of):

1.12.1

The Issue

Please describe the issue that you are experiencing.

Twine is unconditionally importing readme_renderer.markdown but is not depending on readme_renderer[md], thus triggering a UserWarning when twine check is executed.

Steps to Reproduce

run twine check and observe

/path/to/virtualenv/lib/python3.6/site-packages/readme_renderer/markdown.py:38: UserWarning: Markdown renderers are not available. Install 'readme_render[md]' to enable Markdown rendering.
  warnings.warn(_EXTRA_WARNING)

Proposed fix

Do not import readme_renderer.markdown unless the content-type text/markdown is found. Then when validation fails the user sees the warning and knows they need to install the extra dependency.

https://github.com/pypa/twine/blob/bd1d8b0f3ffdae9b91672d075d58cf635aa0e0f6/twine/commands/check.py#L27

Most helpful comment

I'm planning to fix this.

All 2 comments

I'm planning to fix this.

Nice, when will it be released (1.12.3)?

Was this page helpful?
0 / 5 - 0 ratings