-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Description
Describe the bug
When building docs with enums like this:
.. autoclass:: Transpose
:members:
:undoc-members:Referring to code like this:
class Transpose(IntEnum):
FLIP_LEFT_RIGHT = 0
FLIP_TOP_BOTTOM = 1
ROTATE_90 = 2
ROTATE_180 = 3
ROTATE_270 = 4
TRANSPOSE = 5
TRANSVERSE = 6I get no warnings with Python 3.10. But with Python 3.11 I get a warning:
/Users/huvankem/github/Pillow/src/PIL/Image.py:docstring of PIL.Image.Transpose:7: WARNING: Literal block expected; none found.
How to Reproduce
$ git clone https://github.com/python-pillow/Pillow/
$ cd Pillow
$ pip install -e ".[docs]"
$ cd docs
$ python3.11 -m sphinx.cmd.build -b html -W --keep-going . _build/htmlExpected behavior
No warnings, like with Python 3.10:
$ python3.10 -m sphinx.cmd.build -b html -W --keep-going . _build/htmlYour project
https://github.com/python-pillow/Pillow
Screenshots
OS
macOS 12.3.1 Monterey and Linux 20.04
Python version
Python 3.11.0a7+
Sphinx version
4.5.0
Sphinx extensions
sphinx_copybutton, sphinx_issues, sphinx_removed_in, sphinx.ext.autodoc, sphinx.ext.intersphinx, sphinx.ext.viewcode, sphinxext.opengraph
Extra tools
No response
Additional context
If I add a docstring to the enum the warning goes away:
class Transpose(IntEnum):
"""My docstring"""
FLIP_LEFT_RIGHT = 0
FLIP_TOP_BOTTOM = 1
ROTATE_90 = 2
ROTATE_180 = 3
ROTATE_270 = 4
TRANSPOSE = 5
TRANSVERSE = 6Which is probably a good idea anyway, but I wanted to check if this is an intentional change with Python 3.11, something that needs changing in Sphinx to handle 3.11, or (like #10030) a bug in 3.11.
(3.11 enters beta next week, and is set for full release in October.)
