[Distutils] Detecting rst errors when uploading to pypi

John Anderson sontek at gmail.com
Mon Dec 29 00:54:25 CET 2014

On Sun, Dec 28, 2014 at 9:02 AM, Marius Gedminas <marius at gedmin.as> wrote:

> On Sat, Dec 27, 2014 at 08:26:50PM -0800, John Anderson wrote:
> > Hey, I'm trying to get my README to render properly on pypi but I haven't
> > found a way to detect the errors pypi is experiencing.
> >
> > The package I'm trying to upload is here:
> > https://pypi.python.org/pypi/pyramid_celery
> Are you talking about
> https://pypi.python.org/pypi/pyramid_celery/2.0.0-rc2 or
> https://pypi.python.org/pypi/pyramid_celery/1.4?
> The first looks fine now (have you found the error and fixed it
> already?) while the second looks like it uses some kind of Markdown
> instead of ReStructuredText:
> ``` python
>     pyramid.includes = pyramid_celery
> ```
> > I've checked the README.rst with restview, rst2html, and
> > collective.showdocs and they all render the RST just fine.
> Just to be sure, did you try restview's --pypi-strict mode?
> > It seems like I'm not the only one having this issue:
> >
> https://bitbucket.org/pypa/pypi/issue/161/rest-formatting-fails-and-there-is-no-way
> >
> > So what is the recommended route for debugging the problem?  I would
> really
> > like to fix it but without know the problem I would just to make random
> > guesses.
> restview --long-description is what I use (in the source tree with a
> setup.py: this runs setup.py --long-description and parses the output in
> --pypi-strict mode).
> If that fails to find the error, I try to copy & paste the
> long_description text from PyPI into a text file and use restview
> --pypi-strict directly.
> If that fails, I end up bisecting the long_description text in the web
> form, to see where it starts failing.
> If it's not my package and I can't edit the long_description on the web,
> I tend to give up.

I found the error was a .. code-block::  with no language, I fixed the
README with this commit:


restview with --pypi-strict doesn't detect this (but maybe it should?).   I
even tried ripping the source code from pypi directly to catch the error:


Using it:

python setup.py --long-description | python check_readme.py

but even that didn't cause the error, I assume because I have a more modern
version of pygments.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/distutils-sig/attachments/20141228/f025e451/attachment-0001.html>

More information about the Distutils-SIG mailing list