GeezerVison is showing github.com — Fixing README.rst to render correctly on PyPI. by dhermes · Pull Request #434 · googleapis/google-cloud-python
Conversation
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|

Coverage remained the same when pulling 76ce9e6 on dhermes:fix-readme-for-pypi into c2ba130 on GoogleCloudPlatform:master.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
Here is how I test the renderings:
$ python setup.py --long-description | rst2html > /tmp/foo && firefox /tmp/foo
Warnings show up in nice, hard-to-ignore dropshadow boxes.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
My example assumed that we were setting the long_description argument to setup() based on README.rst, which we don't (but should). E.g.:
import os
from setuptools import setup, find_packages
here = os.path.abspath(os.path.dirname(__file__))
with open(os.path.join(here, 'README.rst')) as f:
README = f.read()
setup(
name='gcloud',
version='0.3.0',
description='API Client library for Google Cloud',
long_description=README,
#...
)
It could include CHANGES.rst, too, if we hand that file. E.g.:
import os
from setuptools import setup, find_packages
here = os.path.abspath(os.path.dirname(__file__))
with open(os.path.join(here, 'README.rst')) as f:
README = f.read()
with open(os.path.join(here, 'CHANGES.rst')) as f:
CHANGES = f.read()
setup(
name='gcloud',
version='0.3.0',
description='API Client library for Google Cloud',
long_description='\n\n'.join([README, CHANGES]),
#...
)
Doing it that way avoids the need to upload a file: it gets done during the setup.py register stage automatically.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
BTW, the following::
$ rst2html < README.rst > foo.html
shows that the error preventing rendring on PyPI is the inclusion of the .. code:: role, which is Sphinx-only.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
Great! Thanks for that. I googled around for RST validators and had no luck. Will fix the Sphinx parts and ping again.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|

Coverage remained the same when pulling 48249e1 on dhermes:fix-readme-for-pypi into 1f2ed88 on GoogleCloudPlatform:master.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
- Leaving the
.. code section in renders just fine (and with syntax highlighting):

as compared to using just the Some text:: directive (like coagulant does), which doesn't look great:

- A StackOverflow post indicates that
:code: may be an issue but one of the comments notes that .. code is included in the PyPI code.
I think the more likely culprit was the relative link to CONTRIBUTING.rst.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
@tseaver I finally got access to the PyPI project and played around (a bit of binary search) until it rendered.
It turns out the remaining issue was the final relative link LICENSE <LICENSE>__. #Fail that I missed it.
You can check out https://pypi.python.org/pypi/gcloud now and it renders perfectly.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|

Coverage remained the same when pulling beb58b1 on dhermes:fix-readme-for-pypi into 1f2ed88 on GoogleCloudPlatform:master.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
@tseaver PTAL
Is it safe to set
--- a/setup.py
+++ b/setup.py
@@ -25,6 +25,7 @@ setup(
name='gcloud',
version='0.3.0',
description='API Client library for Google Cloud',
+ long_description=open('README.rst', 'r').read(),
author='JJ Geewax',
author_email='[email protected]',
scripts=[],
Also, in doing this, python setup.py --long-description | rst2html didn't give me any warnings about the relative links (LICENSE and CONTRIBUTING).
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
Should be fine to update setup.py to include the long_description. Maybe do it via a with statement to avoid resource warnings under Py3k?
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
dhermes
added a commit
that referenced
this pull request
Dec 18, 2014
Fixing README.rst to render correctly on PyPI.
atulep
pushed a commit
that referenced
this pull request
Apr 6, 2023
Source-Link: googleapis/synthtool@703554a
Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:94961fdc5c9ca6d13530a6a414a49d2f607203168215d074cdb0a1df9ec31c0b
atulep
pushed a commit
that referenced
this pull request
Apr 18, 2023
Source-Link: googleapis/synthtool@703554a
Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:94961fdc5c9ca6d13530a6a414a49d2f607203168215d074cdb0a1df9ec31c0b
parthea
pushed a commit
that referenced
this pull request
Jun 4, 2023
Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
parthea
added a commit
that referenced
this pull request
Jul 6, 2023
Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
Co-authored-by: Anthonios Partheniou <[email protected]>
parthea
added a commit
that referenced
this pull request
Aug 15, 2023
* feat: add prebuilt telecom webhook python sample code and test
* feat:add test
* fix:lint errors
* fix:add new line at the end of file
* fix: add more comprehensive tests
* fix: pylint
* feat:change helper function and address comments
* fix: pylint
Co-authored-by: nicain <[email protected]>
Co-authored-by: Anthonios Partheniou <[email protected]>
parthea
pushed a commit
that referenced
this pull request
Sep 22, 2023
Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
parthea
pushed a commit
that referenced
this pull request
Oct 21, 2023
Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
parthea
pushed a commit
that referenced
this pull request
Oct 21, 2023
Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
parthea
pushed a commit
that referenced
this pull request
Oct 22, 2023
Source-Link: googleapis/synthtool@703554a
Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:94961fdc5c9ca6d13530a6a414a49d2f607203168215d074cdb0a1df9ec31c0b
parthea
pushed a commit
that referenced
this pull request
Nov 24, 2025
Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
parthea
pushed a commit
that referenced
this pull request
Nov 24, 2025
Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
parthea
pushed a commit
that referenced
this pull request
Nov 26, 2025
Closes #434.
This PR adds a non-None default timeout to `AuthorizedSession.request()` to prevent requests from hanging indefinitely in a default case.
Should help with googleapis/google-cloud-python#10182
parthea
pushed a commit
that referenced
this pull request
Mar 2, 2026
* samples(test): flaky sync pull test
* address peter's comment
parthea
pushed a commit
that referenced
this pull request
Mar 6, 2026
* ci: skip test_readonly_root only on Kokoro
fixes #407
* ci: remove migration_test_data_persistence skip
fixes #408
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
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.
|