Skip to content

Sphinx 7.2 breaks generated documentation headers #11618

Closed
@oddbookworm

Description

@oddbookworm

Describe the bug

Updating to sphinx 7.2.0 (or higher, including 7.2.2) breaks our documentation headers at pygame-ce. As an example, here's the current doc page for pygame-ce's draw module, and here's what the doc looks like when I generate locally with 7.2.0 (7.1.2 produces what's on github)

/* Auto generated file: with makeref.py .  Docs go in docs/reST/ref/ . */
#define DOC_DRAW_RECT "rect(surface, color, rect) -> Rect\nrect(surface, color, rect, width=0, border_radius=0, border_top_left_radius=-1, border_top_right_radius=-1, border_bottom_left_radius=-1, border_bottom_right_radius=-1) -> Rect\ndraw a rectangle"

The reST source for that doc is here and here is our makeref.py

How to Reproduce

Create a pygame-ce dev environment (our github wiki has instructions)
Install sphinx 7.2-7.2.2 (all of these versions give broken doc headers)
python setup.py docs --fullgeneration
python setup.py install
You should see an error about undefined references to DOC_****
Install sphinx 7.1.2 (or earlier) and try again. Should work

Environment Information

Platform:              linux; (Linux-6.1.44-1-MANJARO-x86_64-with-glibc2.38)
Python version:        3.11.3 (main, Jun  5 2023, 09:32:32) [GCC 13.1.1 20230429])
Python implementation: CPython
Sphinx version:        7.2.2
Docutils version:      0.20.1
Jinja2 version:        3.1.2
Pygments version:      2.15.1

This is from my local environment, but we also see the issue in our CI runs for MacOS, Windows, Debian/Ubuntu, and ManyLinux

Sphinx extensions

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions