From 9a7621bc8eb5fc9944dc6b7f1c86b8d5ba94c6ce Mon Sep 17 00:00:00 2001 From: Dustin Ingram Date: Fri, 21 Sep 2018 12:15:02 -0500 Subject: [PATCH 1/2] Recommend using `twine check` instead --- README.rst | 29 ++++-------------------- readme_renderer/integration/distutils.py | 9 ++++++++ 2 files changed, 14 insertions(+), 24 deletions(-) diff --git a/README.rst b/README.rst index 438dc31..ed868db 100644 --- a/README.rst +++ b/README.rst @@ -12,30 +12,8 @@ reStructuredText (``.rst``), and plain text. Check Description Locally ------------------------- -reStructuredText -~~~~~~~~~~~~~~~~ - -To locally check whether your reStructuredText long descriptions will render on -PyPI, simply install the ``readme_renderer`` library using: - -.. code-block:: console - - $ pip install readme_renderer - $ python setup.py check -r -s - running check - -If there's a problem rendering your ``long_description``, the check -will tell you. If your ``long_description`` is fine, you'll get no -output. - - -Markdown -~~~~~~~~ - -Checking your Markdown long descriptions is unecessary, because unlike rST, -where a properly rendered description is all-or-nothing, PyPI will still render -your Markdown description as Markdown if it has some invalid or incorrect -syntax. +To locally check whether your long descriptions will render on PyPI, first +build your distributions, and then use the |twine check|_ command. Code of Conduct @@ -44,4 +22,7 @@ Code of Conduct Everyone interacting in the readme_renderer project's codebases, issue trackers, chat rooms, and mailing lists is expected to follow the `PyPA Code of Conduct`_. + +.. |twine check| replace:: ``twine check`` +.. _twine check: https://github.com/pypa/twine#twine-check .. _PyPA Code of Conduct: https://www.pypa.io/en/latest/code-of-conduct/ diff --git a/readme_renderer/integration/distutils.py b/readme_renderer/integration/distutils.py index 43cf6a5..69660c2 100644 --- a/readme_renderer/integration/distutils.py +++ b/readme_renderer/integration/distutils.py @@ -19,6 +19,7 @@ import distutils.log from distutils.command.check import check as _check +from distutils.core import Command import six from ..rst import render @@ -61,6 +62,14 @@ def check_restructuredtext(self): """ Checks if the long string fields are reST-compliant. """ + # Warn that this command is deprecated + # Don't use self.warn() because it will cause the check to fail. + Command.warn( + self, + "This command has been deprecated. Use `twine check` instead: " + "https://github.com/pypa/twine#twine-check" + ) + data = self.distribution.get_long_description() content_type = getattr( self.distribution.metadata, 'long_description_content_type', None) From 35c0885a3198e71f2b521e5020c2c1afdad6dde7 Mon Sep 17 00:00:00 2001 From: Dustin Ingram Date: Mon, 24 Sep 2018 12:09:15 -0500 Subject: [PATCH 2/2] Use PyPUG guide link instead --- README.rst | 2 +- readme_renderer/integration/distutils.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/README.rst b/README.rst index ed868db..55a6e4b 100644 --- a/README.rst +++ b/README.rst @@ -24,5 +24,5 @@ chat rooms, and mailing lists is expected to follow the `PyPA Code of Conduct`_. .. |twine check| replace:: ``twine check`` -.. _twine check: https://github.com/pypa/twine#twine-check +.. _twine check: https://packaging.python.org/guides/making-a-pypi-friendly-readme#validating-restructuredtext-markup .. _PyPA Code of Conduct: https://www.pypa.io/en/latest/code-of-conduct/ diff --git a/readme_renderer/integration/distutils.py b/readme_renderer/integration/distutils.py index 69660c2..98d0f08 100644 --- a/readme_renderer/integration/distutils.py +++ b/readme_renderer/integration/distutils.py @@ -67,7 +67,8 @@ def check_restructuredtext(self): Command.warn( self, "This command has been deprecated. Use `twine check` instead: " - "https://github.com/pypa/twine#twine-check" + "https://packaging.python.org/guides/making-a-pypi-friendly-readme" + "#validating-restructuredtext-markup" ) data = self.distribution.get_long_description()