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

Recommend using twine check instead #122

Merged
merged 2 commits into from
Sep 24, 2018
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 5 additions & 24 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, perhaps it would be better to link to the new section that pypa/packaging.python.org#554 is adding instead. I'll update this after that's merged.

.. _PyPA Code of Conduct: https://www.pypa.io/en/latest/code-of-conduct/
9 changes: 9 additions & 0 deletions readme_renderer/integration/distutils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down