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" is emitting a UserWarning when executed because it's misusing readme_renderer #420

Closed
mmerickel opened this issue Oct 28, 2018 · 2 comments

Comments

@mmerickel
Copy link

  1. Your operating system:

macOS 10.14

  1. Version of python you are running:

3.7.0

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

pip

  1. 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.

import readme_renderer.markdown

@di
Copy link
Sponsor Member

di commented Oct 28, 2018

I'm planning to fix this.

@nok
Copy link

nok commented Nov 11, 2018

Nice, when will it be released (1.12.3)?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants