Check for reStructuredText syntax errors in README+NEWS while running release command #3556
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
it happened a few times that one updates the NEWS.rst and doesn't check that it is still valid reStructuredText, only to find out later on while publishing the wheels that the
long_description
contains syntax error and would display as plain text on PyPI.This ensures that we run the
readme_renderer
to render the .rst and check for any syntax errors before it proceeds to bump the version in the samepython setup.py release
command.This is the same thing that
twine check
does when verifying the metadata of a package.I can't easily add a test for this, but rest assured that I have tried locally a few times and it works.
The release workflow does not change. The only gotcha is that it's preferable to install bump2version and readme_renderer in the venv before running
setup.py release
, otherwise the old (deprecated)setup_requires
egg installation method would be used to fetch them and sometimes this fails forpackage_readme
for reasons that I haven't figured out.