[PyPI] Checking reST compliance of long description
Hi, I just tried to upload a new package with a pretty long long_description. After uploading PyPI showed the text as plain/text...obviously an error within the reST structure. Because of the length it took me half an hour for figuring out the error. My local rst2html script did not report any errors. So what is the recommended approach for checking a reST file for PyPI compliance instead doing fixing-and-re-registering the package? Andreas -- ZOPYX Ltd. & Co. KG - Charlottenstr. 37/1 - 72070 Tübingen - Germany Web: www.zopyx.com - Email: info@zopyx.com - Phone +49 - 7071 - 793376 Registergericht: Amtsgericht Stuttgart, Handelsregister A 381535 Geschäftsführer/Gesellschafter: ZOPYX Limited, Birmingham, UK ------------------------------------------------------------------------ E-Publishing, Python, Zope & Plone development, Consulting
On Mar 1, 2008, at 9:58 AM, Andreas Jung wrote:
Hi,
I just tried to upload a new package with a pretty long long_description. After uploading PyPI showed the text as plain/text...obviously an error within the reST structure. Because of the length it took me half an hour for figuring out the error. My local rst2html script did not report any errors.
That's very odd.
So what is the recommended approach for checking a reST file for PyPI compliance instead doing fixing-and-re-registering the package?
I have my setup file write the long description to a file and then I test it with rest2html (actually the rst2 script from zc.rst2) before uploading it. It's puzzling to me that rest2html didn't give you an error when PyPI didn't like the text. Jim -- Jim Fulton Zope Corporation
On Sat, Mar 1, 2008 at 4:26 PM, Jim Fulton <jim@zope.com> wrote:
On Mar 1, 2008, at 9:58 AM, Andreas Jung wrote:
Hi,
I just tried to upload a new package with a pretty long long_description. After uploading PyPI showed the text as plain/text...obviously an error within the reST structure. Because of the length it took me half an hour for figuring out the error. My local rst2html script did not report any errors.
That's very odd.
So what is the recommended approach for checking a reST file for PyPI compliance instead doing fixing-and-re-registering the package?
I have my setup file write the long description to a file and then I test it with rest2html (actually the rst2 script from zc.rst2) before uploading it. It's puzzling to me that rest2html didn't give you an error when PyPI didn't like the text.
Yes I wish Pypi would return some kind of warning when the reST compiling fails (see my previous message on this)... A simple check on client side I do with docutils is : python setup.py --long-description | rst2html.py > /dev/null
Jim
-- Jim Fulton Zope Corporation
_______________________________________________ Distutils-SIG maillist - Distutils-SIG@python.org http://mail.python.org/mailman/listinfo/distutils-sig
-- Tarek Ziadé | Association AfPy | www.afpy.org Blog FR | http://programmation-python.org Blog EN | http://tarekziade.wordpress.com/
This could be due to a bug in the way that distutils escapes (folds) whitespace in the long_description field. I have seen that cause errors when rst2html expects indentation which has been lost in the escaping process. For more information see: http://bugs.python.org/issue1923 (meaningful whitespace can be lost in rfc822_escape). There is also a patch there which you could apply and see if it solves your problem. It looks like there may be another issue with the unfolding of this field: http://bugs.python.org/issue504152. It would be great to see these bugs addressed. Stephen Emslie On Sat, Mar 1, 2008 at 3:32 PM, Tarek Ziadé <ziade.tarek@gmail.com> wrote:
On Sat, Mar 1, 2008 at 4:26 PM, Jim Fulton <jim@zope.com> wrote:
On Mar 1, 2008, at 9:58 AM, Andreas Jung wrote:
Hi,
I just tried to upload a new package with a pretty long long_description. After uploading PyPI showed the text as plain/text...obviously an error within the reST structure. Because of the length it took me half an hour for figuring out the error. My local rst2html script did not report any errors.
That's very odd.
So what is the recommended approach for checking a reST file for PyPI compliance instead doing fixing-and-re-registering the package?
I have my setup file write the long description to a file and then I test it with rest2html (actually the rst2 script from zc.rst2) before uploading it. It's puzzling to me that rest2html didn't give you an error when PyPI didn't like the text.
Yes I wish Pypi would return some kind of warning when the reST compiling fails (see my previous message on this)...
A simple check on client side I do with docutils is :
python setup.py --long-description | rst2html.py > /dev/null
Jim
-- Jim Fulton Zope Corporation
_______________________________________________ Distutils-SIG maillist - Distutils-SIG@python.org http://mail.python.org/mailman/listinfo/distutils-sig
-- Tarek Ziadé | Association AfPy | www.afpy.org Blog FR | http://programmation-python.org Blog EN | http://tarekziade.wordpress.com/ _______________________________________________ Distutils-SIG maillist - Distutils-SIG@python.org http://mail.python.org/mailman/listinfo/distutils-sig
--On 3. März 2008 10:58:33 +0000 stephen emslie <stephenemslie@gmail.com> wrote:
This could be due to a bug in the way that distutils escapes (folds) whitespace in the long_description field. I have seen that cause errors when rst2html expects indentation which has been lost in the escaping process.
For more information see: http://bugs.python.org/issue1923 (meaningful whitespace can be lost in rfc822_escape). There is also a patch there which you could apply and see if it solves your problem.
It looks like there may be another issue with the unfolding of this field: http://bugs.python.org/issue504152.
As part of my work on haufe.releaser I added new setuptools command 'check_description' that performs a reST check before uploading a dist file: <http://pypi.python.org/pypi/haufe.releaser/> Andreas
participants (4)
-
Andreas Jung
-
Jim Fulton
-
stephen emslie
-
Tarek Ziadé