Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to ensure that README.rst is valid?

There are two version of my little tool:

  • https://pypi.python.org/pypi/tbzuploader/2017.11.0
  • https://pypi.python.org/pypi/tbzuploader/2017.12.0 Bug: The pypi page looks ugly.

In the last update a change in README.rst cases a warning:

user@host> rst2html.py README.rst  > /tmp/foo.html
README.rst:18: (WARNING/2) Inline emphasis start-string without end-string.
README.rst:18: (WARNING/2) Inline emphasis start-string without end-string.

Now the pypi page looks ugly :-(

I use this recipe to do CI, bumpversion, upload to pypi: https://github.com/guettli/github-travis-bumpversion-pypi

How could I ensure that no broken README.rst gets released any more? With other words I want to avoid that the pypi page looks ugly.

Dear detail lovers: Please don't look into the current particular error in the README.rst. That's is not the question :-)

like image 755
guettli Avatar asked Oct 11 '17 07:10

guettli


People also ask

How do I open a readme file in RST?

Microsoft Notepad and Microsoft WordPad are popular text editors that can be used to open, view, create and edit RST files, since these applications along with the Microsoft Windows platform provide support for the reStructuredText markup language.

Can GitHub render RST?

There are of course tools to render . rst as HTML but that's a serious extra step. The whole reason we started using . rst was entirely because GitHub renders it automatically in code pages.

What is RST markdown?

Markdown and reStructuredText are two markup languages with plain text formatting syntax designed for easy input with any text editor. Each has a whole host of tools that can convert marked up text to publishing formats like HTML or PDF.


1 Answers

Preamble

I had a readme which would not render on PyPi, other than the first element on the page (an image). I ran the file against multiple validators, and tested it against other renders. It worked perfectly fine everywhere else! So, after a long, nasty fight with it, and numerous version bumps so I could test a PyPi revision, I tried reducing the file to a bare minimum, from which I'd build it back up. It turned out that the first line was always processed, and then nothing else was...

Solution

Discovering this clue regarding the first line, I then had an epiphany... All I had to do was change the line endings in the file! I was editing the file in Windows, with Windows line endings being tacked on implicitly. I changed that to Unix style and (poof!) PyPi fully rendered the doc!

Rant...

I've encountered such things in the past, but I took it for granted that PyPi would handle cross platform issues like this. I mean one of the key features of Python is being cross platform! Am I the first person working in Windows to encounter this?! I don't appreciate the hours of time this wasted.

like image 135
BuvinJ Avatar answered Oct 10 '22 21:10

BuvinJ