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

Check for reStructuredText syntax errors in README+NEWS while running release command #3556

Merged
merged 3 commits into from
Jun 3, 2024

Conversation

anthrotype
Copy link
Member

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 same python 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 for package_readme for reasons that I haven't figured out.

setup_requires is deprecated, and relying on it to bootstrap the readme_renderer sometimes fails, better to ensure it's already pip installed before running release command
@anthrotype anthrotype force-pushed the check-rst-syntax-before-release branch from b83bcd3 to 162cacb Compare June 3, 2024 11:15
@anthrotype anthrotype merged commit 5e6b12d into main Jun 3, 2024
9 checks passed
@anthrotype anthrotype deleted the check-rst-syntax-before-release branch June 3, 2024 11:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants