Skip to content

Auth: docs CI check fails due to upstream requests 2.34.x docstring formatting regression #17145

@nbayati

Description

@nbayati

Determine this is the right repository

  • I determined this is the correct repository in which to report this bug.

Summary of the issue

The docs CI check is failing during the Sphinx documentation build for google-auth (and potentially other packages that inherit from requests.Session). The build fails with an unexpected docutils warning which is treated as an error due to the strict -W flag. Here's the log:

/google/auth/transport/requests.py:docstring of requests.sessions.Session.get:5: WARNING: Field list ends without a blank line; unexpected unindent. [docutils]
...
build finished with problems, 1 warning (with warnings treated as errors).
nox > Command sphinx-build -T -W -N -b html -d docs/_build/doctrees/ docs/ docs/_build/html/ failed with exit code 1
nox > Session docs failed.

Root Cause

The requests library recently released version 2.34.0 (with subsequent patch updates up to 2.34.2 today) which introduced inline typings and docstring refactoring. The new docstring for requests.sessions.Session.get contains a reStructuredText formatting error (missing indentation on the second line of the :param params: description):

:param params: (optional) Dictionary, list of tuples or bytes to send
in the query string for the :class:`Request`.  <-- Missing indentation here

google-auth defines AuthorizedSession which inherits from requests.Session. Sphinx's autodoc pulls in the inherited get docstring to document it, triggering the docutils warning.
Since the CI build uses -W (warnings as errors), this third-party formatting warning crashes the entire build.

Suggested Workaround / Fix

Until the issue is fixed upstream in the requests library, we can unblock the CI by pinning requests to a known stable version (e.g., 2.31.0) specifically for the docs session in noxfile.py:

@nox.session(python="3.10")
def docs(session):
    """Build the docs for this library."""

    session.install("-e", ".[aiohttp]")
    session.install("requests==2.31.0")  # Pin to avoid upstream docstring formatting bug
    session.install("sphinx", "alabaster", "recommonmark", "sphinx-docstring-typing")
    ...

Metadata

Metadata

Assignees

No one assigned

    Labels

    triage meI really want to be triaged.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions