Fix PyPI README rendering metadata#1341
Conversation
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
There was a problem hiding this comment.
Code Review
This pull request updates an image source URL in README.md and specifies the long description content type as markdown in setup.py. The reviewer pointed out that setting the content type to markdown causes a duplicate title rendering on PyPI due to a prepended RST-style header in setup.py, and suggested reading the README file directly without prepending the redundant header.
| maintainer_email='quantum-oss-maintainers@google.com', | ||
| description=('The electronic structure package for quantum computers.'), | ||
| long_description=long_description, | ||
| long_description_content_type='text/markdown', |
There was a problem hiding this comment.
Setting long_description_content_type to 'text/markdown' causes the prepended RST-style header on lines 23-25 (long_description = '===========\n' + 'OpenFermion\n' + '===========\n\n') to be parsed as a Markdown H1 header. Since README.md already contains a # OpenFermion header, this results in a duplicate title rendering on PyPI.
To fix this, please update lines 23-25 to read the file directly without prepending the redundant header:
with open('README.md', 'r', encoding='utf-8') as readme:
long_description = readme.read()
Fixes #1317.
This fixes the PyPI README rendering metadata and uses the canonical raw GitHub URL for the Quantum AI logo image.
Changes:
long_description_content_type='text/markdown'so PyPI renders the README as Markdown/HTML instead of plain text.refs/heads/mainraw image URL with the canonical/main/raw URL.Validation:
python -m build --sdist --wheelfrom isolated venvC:\hades\oss\.venvs\openfermion-1317python -m twine check dist\*Description-Content-Type: text/markdownNote: build emitted an existing setuptools license-classifier deprecation warning unrelated to this change.