qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/4] Docs: bump sphinx version to 6.2.1
@ 2025-06-06 20:50 John Snow
  2025-06-06 20:50 ` [PATCH 1/4] python: update requirements for Sphinx John Snow
                   ` (5 more replies)
  0 siblings, 6 replies; 9+ messages in thread
From: John Snow @ 2025-06-06 20:50 UTC (permalink / raw)
  To: qemu-devel; +Cc: John Snow, Peter Maydell, Akihiko Odaki, Cleber Rosa

This is a re-send of Akihiko Odaki's series, rebased and altered to cope
with the new QAPI static analysis tests now running on GitLab CI.

Changes in this "v1":

 - Update python static analysis testing configuration to work with the
   new Sphinx minimum version
 - Small adjustments to qapi_domain.py in light of upstream changes to
   keep new CI tests passing.
   (Thank you for deleting compat.py, Odaki-san!)
 - Make the minimum versions for sphinx and sphinx-rtd-theme more
   explicit, including the patch version number; thiis is *required* for
   Debian platforms which ship sphinx-rtd-theme 1.2.1 and will fail to
   build docs otherwise.

Akihiko Odaki (3):
  docs: Bump sphinx to 6.2.1
  docs: Require sphinx>=6.2
  MAINTAINERS: Add docs/requirements.txt

John Snow (1):
  python: update requirements for Sphinx

 MAINTAINERS                |   1 +
 docs/requirements.txt      |   4 +-
 docs/sphinx/compat.py      | 230 -------------------------------------
 docs/sphinx/qapi_domain.py |  38 +++---
 python/setup.cfg           |   2 +-
 python/tests/minreqs.txt   |  36 +++---
 python/tests/qapi-isort.sh |   4 +-
 pythondeps.toml            |   4 +-
 8 files changed, 46 insertions(+), 273 deletions(-)
 delete mode 100644 docs/sphinx/compat.py

-- 
2.48.1




^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH 1/4] python: update requirements for Sphinx
  2025-06-06 20:50 [PATCH 0/4] Docs: bump sphinx version to 6.2.1 John Snow
@ 2025-06-06 20:50 ` John Snow
  2025-06-08  5:26   ` Akihiko Odaki
  2025-06-06 20:50 ` [PATCH 2/4] docs: Bump sphinx to 6.2.1 John Snow
                   ` (4 subsequent siblings)
  5 siblings, 1 reply; 9+ messages in thread
From: John Snow @ 2025-06-06 20:50 UTC (permalink / raw)
  To: qemu-devel; +Cc: John Snow, Peter Maydell, Akihiko Odaki, Cleber Rosa

In advance of actually bumping the build system requirements for Sphinx,
bump the version used for the static analysis tests. Update the minimum
requirements accordingly.

This changes the test environment without actually changing the build
requirements, and no extra changes are needed for the tests to continue
passing.

Signed-off-by: John Snow <jsnow@redhat.com>
---
 python/setup.cfg         |  2 +-
 python/tests/minreqs.txt | 36 +++++++++++++++++++++---------------
 2 files changed, 22 insertions(+), 16 deletions(-)

diff --git a/python/setup.cfg b/python/setup.cfg
index d7f5dc7bafe..dc9615c1173 100644
--- a/python/setup.cfg
+++ b/python/setup.cfg
@@ -46,7 +46,7 @@ devel =
     urwid >= 2.1.2
     urwid-readline >= 0.13
     Pygments >= 2.9.0
-    sphinx >= 3.4.3
+    sphinx >= 6.2.1
 
 # Provides qom-fuse functionality
 fuse =
diff --git a/python/tests/minreqs.txt b/python/tests/minreqs.txt
index cd2e2a81c3d..fd7ec40929b 100644
--- a/python/tests/minreqs.txt
+++ b/python/tests/minreqs.txt
@@ -11,19 +11,19 @@
 # When adding new dependencies, pin the very oldest non-yanked version
 # on PyPI that allows the test suite to pass.
 
-# For some reason, the presence of packaging==14.0 below requires us to
+# For some reason, the presence of packaging==21.0 below requires us to
 # also pin setuptools to version 70 or below. Otherwise, the
 # installation of the QEMU package itself fails, failing to find
 # setuptools.
 setuptools<=70
 
 # Dependencies for qapidoc/qapi_domain et al
-sphinx==3.4.3
+sphinx==6.2.1
 
 # Dependencies for the TUI addon (Required for successful linting)
 urwid==2.1.2
 urwid-readline==0.13
-Pygments==2.9.0
+Pygments==2.13.0
 
 # Dependencies for mkvenv
 distlib==0.3.6
@@ -55,24 +55,30 @@ astroid==2.15.4
 dill==0.2
 lazy-object-proxy==1.4.0
 platformdirs==2.2.0
-toml==0.10.0
 tomlkit==0.10.1
 wrapt==1.14.0
 
 # Transitive sphinx dependencies
-Jinja2==2.7
-MarkupSafe==1.1.0
+Jinja2==3.0
+MarkupSafe==2.0.0
 alabaster==0.7.1
-babel==1.3
-docutils==0.12
-imagesize==0.5.0
-packaging==14.0
-pytz==2011b0
-requests==2.5.0
-snowballstemmer==1.1
+babel==2.9
+certifi==2017.4.17
+chardet==3.0.2
+docutils==0.18.1
+idna==2.5
+imagesize==1.3
+importlib-metadata==4.8.1
+packaging==21.0
+pyparsing==2.0.2
+pytz==2015.7
+requests==2.25.0
+snowballstemmer==2.0
 sphinxcontrib-applehelp==1.0.0
 sphinxcontrib-devhelp==1.0.0
-sphinxcontrib-htmlhelp==1.0.0
+sphinxcontrib-htmlhelp==2.0.0
 sphinxcontrib-jsmath==1.0.0
 sphinxcontrib-qthelp==1.0.0
-sphinxcontrib-serializinghtml==1.0.0
+sphinxcontrib-serializinghtml==1.1.5
+urllib3==1.21.1
+zipp==0.5
-- 
2.48.1



^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 2/4] docs: Bump sphinx to 6.2.1
  2025-06-06 20:50 [PATCH 0/4] Docs: bump sphinx version to 6.2.1 John Snow
  2025-06-06 20:50 ` [PATCH 1/4] python: update requirements for Sphinx John Snow
@ 2025-06-06 20:50 ` John Snow
  2025-06-06 20:50 ` [PATCH 3/4] docs: Require sphinx>=6.2 John Snow
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 9+ messages in thread
From: John Snow @ 2025-06-06 20:50 UTC (permalink / raw)
  To: qemu-devel
  Cc: John Snow, Peter Maydell, Akihiko Odaki, Cleber Rosa,
	Markus Armbruster

From: Akihiko Odaki <akihiko.odaki@daynix.com>

sphinx 5.3.0 fails with Python 3.13.1:

../docs/meson.build:37: WARNING: /home/me/qemu/build/pyvenv/bin/sphinx-build:
Extension error:
Could not import extension sphinx.builders.epub3 (exception: No module named 'imghdr')

../docs/meson.build:39:6: ERROR: Problem encountered: Install a Python 3 version of python-sphinx and the readthedoc theme

Bump sphinx to 6.2.1 and also sphinx_rtd_theme as required for the new
sphinx version.

(jsnow note: this patch bumps the recommended version for Sphinx to
install when it is missing, but allows old versions to be used if they
are present and functional. The version used for building docs on
readthedocs is pinned to the recommended version, 6.2.1.)

Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com>
Tested-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: John Snow <jsnow@redhat.com>
Signed-off-by: John Snow <jsnow@redhat.com>
---
 docs/requirements.txt | 4 ++--
 pythondeps.toml       | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/docs/requirements.txt b/docs/requirements.txt
index 02583f209aa..87f7afcb2e7 100644
--- a/docs/requirements.txt
+++ b/docs/requirements.txt
@@ -1,5 +1,5 @@
 # Used by readthedocs.io
 # Should be in sync with the "installed" key of pythondeps.toml
 
-sphinx==5.3.0
-sphinx_rtd_theme==1.1.1
+sphinx==6.2.1
+sphinx_rtd_theme==1.2.2
diff --git a/pythondeps.toml b/pythondeps.toml
index 7884ab521d1..b2eec940ce5 100644
--- a/pythondeps.toml
+++ b/pythondeps.toml
@@ -24,8 +24,8 @@ pycotap = { accepted = ">=1.1.0", installed = "1.3.1" }
 
 [docs]
 # Please keep the installed versions in sync with docs/requirements.txt
-sphinx = { accepted = ">=3.4.3", installed = "5.3.0", canary = "sphinx-build" }
-sphinx_rtd_theme = { accepted = ">=0.5", installed = "1.1.1" }
+sphinx = { accepted = ">=3.4.3", installed = "6.2.1", canary = "sphinx-build" }
+sphinx_rtd_theme = { accepted = ">=0.5", installed = "1.2.2" }
 
 [testdeps]
 qemu.qmp = { accepted = ">=0.0.3", installed = "0.0.3" }
-- 
2.48.1



^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 3/4] docs: Require sphinx>=6.2
  2025-06-06 20:50 [PATCH 0/4] Docs: bump sphinx version to 6.2.1 John Snow
  2025-06-06 20:50 ` [PATCH 1/4] python: update requirements for Sphinx John Snow
  2025-06-06 20:50 ` [PATCH 2/4] docs: Bump sphinx to 6.2.1 John Snow
@ 2025-06-06 20:50 ` John Snow
  2025-06-06 20:50 ` [PATCH 4/4] MAINTAINERS: Add docs/requirements.txt John Snow
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 9+ messages in thread
From: John Snow @ 2025-06-06 20:50 UTC (permalink / raw)
  To: qemu-devel; +Cc: John Snow, Peter Maydell, Akihiko Odaki, Cleber Rosa

From: Akihiko Odaki <akihiko.odaki@daynix.com>

This makes docs/sphinx/compat.py unnecessary. The accepted range of the
sphinx_rtd_theme version was also changed to >=1.2.1 for compatibility
with sphinx>=6.2.

Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com>
[Minor edits for rebase and CI verdancy. --js]
Signed-off-by: John Snow <jsnow@redhat.com>
---
 docs/sphinx/compat.py      | 230 -------------------------------------
 docs/sphinx/qapi_domain.py |  38 +++---
 python/tests/qapi-isort.sh |   4 +-
 pythondeps.toml            |   4 +-
 4 files changed, 21 insertions(+), 255 deletions(-)
 delete mode 100644 docs/sphinx/compat.py

diff --git a/docs/sphinx/compat.py b/docs/sphinx/compat.py
deleted file mode 100644
index 9cf7fe006e4..00000000000
--- a/docs/sphinx/compat.py
+++ /dev/null
@@ -1,230 +0,0 @@
-"""
-Sphinx cross-version compatibility goop
-"""
-
-import re
-from typing import (
-    TYPE_CHECKING,
-    Any,
-    Callable,
-    Optional,
-    Type,
-)
-
-from docutils import nodes
-from docutils.nodes import Element, Node, Text
-from docutils.statemachine import StringList
-
-import sphinx
-from sphinx import addnodes, util
-from sphinx.directives import ObjectDescription
-from sphinx.environment import BuildEnvironment
-from sphinx.roles import XRefRole
-from sphinx.util import docfields
-from sphinx.util.docutils import (
-    ReferenceRole,
-    SphinxDirective,
-    switch_source_input,
-)
-from sphinx.util.typing import TextlikeNode
-
-
-MAKE_XREF_WORKAROUND = sphinx.version_info[:3] < (4, 1, 0)
-
-
-SpaceNode: Callable[[str], Node]
-KeywordNode: Callable[[str, str], Node]
-
-if sphinx.version_info[:3] >= (4, 0, 0):
-    SpaceNode = addnodes.desc_sig_space
-    KeywordNode = addnodes.desc_sig_keyword
-else:
-    SpaceNode = Text
-    KeywordNode = addnodes.desc_annotation
-
-
-def nested_parse_with_titles(
-    directive: SphinxDirective, content_node: Element
-) -> None:
-    """
-    This helper preserves error parsing context across sphinx versions.
-    """
-
-    # necessary so that the child nodes get the right source/line set
-    content_node.document = directive.state.document
-
-    try:
-        # Modern sphinx (6.2.0+) supports proper offsetting for
-        # nested parse error context management
-        util.nodes.nested_parse_with_titles(
-            directive.state,
-            directive.content,
-            content_node,
-            content_offset=directive.content_offset,
-        )
-    except TypeError:
-        # No content_offset argument. Fall back to SSI method.
-        with switch_source_input(directive.state, directive.content):
-            util.nodes.nested_parse_with_titles(
-                directive.state, directive.content, content_node
-            )
-
-
-# ###########################################
-# xref compatibility hacks for Sphinx < 4.1 #
-# ###########################################
-
-# When we require >= Sphinx 4.1, the following function and the
-# subsequent 3 compatibility classes can be removed. Anywhere in
-# qapi_domain that uses one of these Compat* types can be switched to
-# using the garden-variety lib-provided classes with no trickery.
-
-
-def _compat_make_xref(  # pylint: disable=unused-argument
-    self: sphinx.util.docfields.Field,
-    rolename: str,
-    domain: str,
-    target: str,
-    innernode: Type[TextlikeNode] = addnodes.literal_emphasis,
-    contnode: Optional[Node] = None,
-    env: Optional[BuildEnvironment] = None,
-    inliner: Any = None,
-    location: Any = None,
-) -> Node:
-    """
-    Compatibility workaround for Sphinx versions prior to 4.1.0.
-
-    Older sphinx versions do not use the domain's XRefRole for parsing
-    and formatting cross-references, so we need to perform this magick
-    ourselves to avoid needing to write the parser/formatter in two
-    separate places.
-
-    This workaround isn't brick-for-brick compatible with modern Sphinx
-    versions, because we do not have access to the parent directive's
-    state during this parsing like we do in more modern versions.
-
-    It's no worse than what pre-Sphinx 4.1.0 does, so... oh well!
-    """
-
-    # Yes, this function is gross. Pre-4.1 support is a miracle.
-    # pylint: disable=too-many-locals
-
-    assert env
-    # Note: Sphinx's own code ignores the type warning here, too.
-    if not rolename:
-        return contnode or innernode(target, target)  # type: ignore[call-arg]
-
-    # Get the role instance, but don't *execute it* - we lack the
-    # correct state to do so. Instead, we'll just use its public
-    # methods to do our reference formatting, and emulate the rest.
-    role = env.get_domain(domain).roles[rolename]
-    assert isinstance(role, XRefRole)
-
-    # XRefRole features not supported by this compatibility shim;
-    # these were not supported in Sphinx 3.x either, so nothing of
-    # value is really lost.
-    assert not target.startswith("!")
-    assert not re.match(ReferenceRole.explicit_title_re, target)
-    assert not role.lowercase
-    assert not role.fix_parens
-
-    # Code below based mostly on sphinx.roles.XRefRole; run() and
-    # create_xref_node()
-    options = {
-        "refdoc": env.docname,
-        "refdomain": domain,
-        "reftype": rolename,
-        "refexplicit": False,
-        "refwarn": role.warn_dangling,
-    }
-    refnode = role.nodeclass(target, **options)
-    title, target = role.process_link(env, refnode, False, target, target)
-    refnode["reftarget"] = target
-    classes = ["xref", domain, f"{domain}-{rolename}"]
-    refnode += role.innernodeclass(target, title, classes=classes)
-
-    # This is the very gross part of the hack. Normally,
-    # result_nodes takes a document object to which we would pass
-    # self.inliner.document. Prior to Sphinx 4.1, we don't *have* an
-    # inliner to pass, so we have nothing to pass here. However, the
-    # actual implementation of role.result_nodes in this case
-    # doesn't actually use that argument, so this winds up being
-    # ... fine. Rest easy at night knowing this code only runs under
-    # old versions of Sphinx, so at least it won't change in the
-    # future on us and lead to surprising new failures.
-    # Gross, I know.
-    result_nodes, _messages = role.result_nodes(
-        None,  # type: ignore
-        env,
-        refnode,
-        is_ref=True,
-    )
-    return nodes.inline(target, "", *result_nodes)
-
-
-class CompatField(docfields.Field):
-    if MAKE_XREF_WORKAROUND:
-        make_xref = _compat_make_xref
-
-
-class CompatGroupedField(docfields.GroupedField):
-    if MAKE_XREF_WORKAROUND:
-        make_xref = _compat_make_xref
-
-
-class CompatTypedField(docfields.TypedField):
-    if MAKE_XREF_WORKAROUND:
-        make_xref = _compat_make_xref
-
-
-# ################################################################
-# Nested parsing error location fix for Sphinx 5.3.0 < x < 6.2.0 #
-# ################################################################
-
-# When we require Sphinx 4.x, the TYPE_CHECKING hack where we avoid
-# subscripting ObjectDescription at runtime can be removed in favor of
-# just always subscripting the class.
-
-# When we require Sphinx > 6.2.0, the rest of this compatibility hack
-# can be dropped and QAPIObject can just inherit directly from
-# ObjectDescription[Signature].
-
-SOURCE_LOCATION_FIX = (5, 3, 0) <= sphinx.version_info[:3] < (6, 2, 0)
-
-Signature = str
-
-
-if TYPE_CHECKING:
-    _BaseClass = ObjectDescription[Signature]
-else:
-    _BaseClass = ObjectDescription
-
-
-class ParserFix(_BaseClass):
-
-    _temp_content: StringList
-    _temp_offset: int
-    _temp_node: Optional[addnodes.desc_content]
-
-    def before_content(self) -> None:
-        # Work around a sphinx bug and parse the content ourselves.
-        self._temp_content = self.content
-        self._temp_offset = self.content_offset
-        self._temp_node = None
-
-        if SOURCE_LOCATION_FIX:
-            self._temp_node = addnodes.desc_content()
-            self.state.nested_parse(
-                self.content, self.content_offset, self._temp_node
-            )
-            # Sphinx will try to parse the content block itself,
-            # Give it nothingness to parse instead.
-            self.content = StringList()
-            self.content_offset = 0
-
-    def transform_content(self, content_node: addnodes.desc_content) -> None:
-        # Sphinx workaround: Inject our parsed content and restore state.
-        if self._temp_node:
-            content_node += self._temp_node.children
-            self.content = self._temp_content
-            self.content_offset = self._temp_offset
diff --git a/docs/sphinx/qapi_domain.py b/docs/sphinx/qapi_domain.py
index ebc46a72c61..1a79a02ecc0 100644
--- a/docs/sphinx/qapi_domain.py
+++ b/docs/sphinx/qapi_domain.py
@@ -31,19 +31,10 @@
 from sphinx.locale import _, __
 from sphinx.roles import XRefRole
 from sphinx.util import logging
+from sphinx.util.docfields import Field, GroupedField, TypedField
 from sphinx.util.docutils import SphinxDirective
 from sphinx.util.nodes import make_id, make_refnode
 
-from compat import (
-    CompatField,
-    CompatGroupedField,
-    CompatTypedField,
-    KeywordNode,
-    ParserFix,
-    Signature,
-    SpaceNode,
-)
-
 
 if TYPE_CHECKING:
     from typing import (
@@ -63,6 +54,7 @@
     from sphinx.util.typing import OptionSpec
 
 
+Signature = str
 logger = logging.getLogger(__name__)
 
 
@@ -157,7 +149,7 @@ def result_nodes(
         return results, []
 
 
-class QAPIDescription(ParserFix):
+class QAPIDescription(ObjectDescription[Signature]):
     """
     Generic QAPI description.
 
@@ -315,7 +307,7 @@ class QAPIObject(QAPIDescription):
 
     doc_field_types = [
         # :feat name: descr
-        CompatGroupedField(
+        GroupedField(
             "feature",
             label=_("Features"),
             names=("feat",),
@@ -327,8 +319,8 @@ def get_signature_prefix(self) -> List[nodes.Node]:
         """Return a prefix to put before the object name in the signature."""
         assert self.objtype
         return [
-            KeywordNode("", self.objtype.title()),
-            SpaceNode(" "),
+            addnodes.desc_sig_keyword("", self.objtype.title()),
+            addnodes.desc_sig_space(" "),
         ]
 
     def get_signature_suffix(self) -> List[nodes.Node]:
@@ -337,7 +329,7 @@ def get_signature_suffix(self) -> List[nodes.Node]:
 
         if "since" in self.options:
             ret += [
-                SpaceNode(" "),
+                addnodes.desc_sig_space(" "),
                 addnodes.desc_sig_element(
                     "", f"(Since: {self.options['since']})"
                 ),
@@ -470,7 +462,11 @@ def _validate_field(self, field: nodes.field) -> None:
             )
             logger.warning(msg, location=field)
 
-    def transform_content(self, content_node: addnodes.desc_content) -> None:
+    def transform_content(
+        self,
+        # pylint: disable=arguments-renamed
+        content_node: addnodes.desc_content
+    ) -> None:
         # This hook runs after before_content and the nested parse, but
         # before the DocFieldTransformer is executed.
         super().transform_content(content_node)
@@ -485,7 +481,7 @@ def transform_content(self, content_node: addnodes.desc_content) -> None:
                     self._validate_field(field)
 
 
-class SpecialTypedField(CompatTypedField):
+class SpecialTypedField(TypedField):
     def make_field(self, *args: Any, **kwargs: Any) -> nodes.field:
         ret = super().make_field(*args, **kwargs)
 
@@ -518,14 +514,14 @@ class QAPICommand(QAPIObject):
                 can_collapse=False,
             ),
             # :error: descr
-            CompatField(
+            Field(
                 "error",
                 label=_("Errors"),
                 names=("error", "errors"),
                 has_arg=False,
             ),
             # :return TypeName: descr
-            CompatGroupedField(
+            GroupedField(
                 "returnvalue",
                 label=_("Return"),
                 rolename="type",
@@ -543,7 +539,7 @@ class QAPIEnum(QAPIObject):
     doc_field_types.extend(
         [
             # :value name: descr
-            CompatGroupedField(
+            GroupedField(
                 "value",
                 label=_("Values"),
                 names=("value",),
@@ -560,7 +556,7 @@ class QAPIAlternate(QAPIObject):
     doc_field_types.extend(
         [
             # :alt type name: descr
-            CompatTypedField(
+            TypedField(
                 "alternative",
                 label=_("Alternatives"),
                 names=("alt",),
diff --git a/python/tests/qapi-isort.sh b/python/tests/qapi-isort.sh
index 78dd947f68c..93c02619541 100755
--- a/python/tests/qapi-isort.sh
+++ b/python/tests/qapi-isort.sh
@@ -2,7 +2,7 @@
 # SPDX-License-Identifier: GPL-2.0-or-later
 
 python3 -m isort --sp . -c ../scripts/qapi/
-# Force isort to recognize "compat" as a local module and not third-party
-python3 -m isort --sp . -c -p compat -p qapidoc_legacy \
+# Force isort to recognize "qapidoc_legacy" as a local module
+python3 -m isort --sp . -c -p qapidoc_legacy \
         ../docs/sphinx/qapi_domain.py \
         ../docs/sphinx/qapidoc.py
diff --git a/pythondeps.toml b/pythondeps.toml
index b2eec940ce5..4a3eab6eee3 100644
--- a/pythondeps.toml
+++ b/pythondeps.toml
@@ -24,8 +24,8 @@ pycotap = { accepted = ">=1.1.0", installed = "1.3.1" }
 
 [docs]
 # Please keep the installed versions in sync with docs/requirements.txt
-sphinx = { accepted = ">=3.4.3", installed = "6.2.1", canary = "sphinx-build" }
-sphinx_rtd_theme = { accepted = ">=0.5", installed = "1.2.2" }
+sphinx = { accepted = ">=6.2.1", installed = "6.2.1", canary = "sphinx-build" }
+sphinx_rtd_theme = { accepted = ">=1.2.2", installed = "1.2.2" }
 
 [testdeps]
 qemu.qmp = { accepted = ">=0.0.3", installed = "0.0.3" }
-- 
2.48.1



^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 4/4] MAINTAINERS: Add docs/requirements.txt
  2025-06-06 20:50 [PATCH 0/4] Docs: bump sphinx version to 6.2.1 John Snow
                   ` (2 preceding siblings ...)
  2025-06-06 20:50 ` [PATCH 3/4] docs: Require sphinx>=6.2 John Snow
@ 2025-06-06 20:50 ` John Snow
  2025-06-11 17:01 ` [PATCH 0/4] Docs: bump sphinx version to 6.2.1 John Snow
  2025-06-24  6:26 ` Markus Armbruster
  5 siblings, 0 replies; 9+ messages in thread
From: John Snow @ 2025-06-06 20:50 UTC (permalink / raw)
  To: qemu-devel; +Cc: John Snow, Peter Maydell, Akihiko Odaki, Cleber Rosa

From: Akihiko Odaki <akihiko.odaki@daynix.com>

Add docs/requirements.txt to
"Sphinx documentation configuration and build machinery".

Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com>
Signed-off-by: John Snow <jsnow@redhat.com>
---
 MAINTAINERS | 1 +
 1 file changed, 1 insertion(+)

diff --git a/MAINTAINERS b/MAINTAINERS
index aa6763077ea..76674c88b0e 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -4379,6 +4379,7 @@ M: Peter Maydell <peter.maydell@linaro.org>
 S: Maintained
 F: docs/conf.py
 F: docs/*/conf.py
+F: docs/requirements.txt
 F: docs/sphinx/
 F: docs/_templates/
 F: docs/devel/docs.rst
-- 
2.48.1



^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH 1/4] python: update requirements for Sphinx
  2025-06-06 20:50 ` [PATCH 1/4] python: update requirements for Sphinx John Snow
@ 2025-06-08  5:26   ` Akihiko Odaki
  2025-06-09 19:07     ` John Snow
  0 siblings, 1 reply; 9+ messages in thread
From: Akihiko Odaki @ 2025-06-08  5:26 UTC (permalink / raw)
  To: John Snow, qemu-devel; +Cc: Peter Maydell, Cleber Rosa

On 2025/06/07 5:50, John Snow wrote:
> In advance of actually bumping the build system requirements for Sphinx,
> bump the version used for the static analysis tests. Update the minimum
> requirements accordingly.
> 
> This changes the test environment without actually changing the build
> requirements, and no extra changes are needed for the tests to continue
> passing.
> 
> Signed-off-by: John Snow <jsnow@redhat.com>

Reviewed-by: Akihiko Odaki <odaki@rsg.ci.i.u-tokyo.ac.jp>

I didn't notice these files. Perhaps they are better to be documented 
with pythondeps.toml.

Regards,
Akihiko Odaki


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 1/4] python: update requirements for Sphinx
  2025-06-08  5:26   ` Akihiko Odaki
@ 2025-06-09 19:07     ` John Snow
  0 siblings, 0 replies; 9+ messages in thread
From: John Snow @ 2025-06-09 19:07 UTC (permalink / raw)
  To: Akihiko Odaki; +Cc: qemu-devel, Peter Maydell, Cleber Rosa

[-- Attachment #1: Type: text/plain, Size: 1441 bytes --]

On Sun, Jun 8, 2025 at 1:26 AM Akihiko Odaki <akihiko.odaki@daynix.com>
wrote:

> On 2025/06/07 5:50, John Snow wrote:
> > In advance of actually bumping the build system requirements for Sphinx,
> > bump the version used for the static analysis tests. Update the minimum
> > requirements accordingly.
> >
> > This changes the test environment without actually changing the build
> > requirements, and no extra changes are needed for the tests to continue
> > passing.
> >
> > Signed-off-by: John Snow <jsnow@redhat.com>
>
> Reviewed-by: Akihiko Odaki <odaki@rsg.ci.i.u-tokyo.ac.jp>
>
> I didn't notice these files. Perhaps they are better to be documented
> with pythondeps.toml.
>

You didn't miss them, they were added after you submitted your patch :)

The python tests checking anything to do with sphinx are very recent. The
relationship between pythondeps.toml and python/setup.cfg and
python/tests/minreqs.txt is still tenuous, but I'll keep in mind that we
may need to better document the relationships.

(Sphinx and its dependencies are installed only for the sake of pylint and
mypy to check docs/sphinx/qapidoc.py and docs/sphinx/qapi_domain.py, as
those packages need to be present in order for the static type analysis to
work fully. We don't actually *run* Sphinx from those tests, we just use
them as "headers", effectively.)

Thanks again,
--js


>
> Regards,
> Akihiko Odaki
>
>

[-- Attachment #2: Type: text/html, Size: 2228 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 0/4] Docs: bump sphinx version to 6.2.1
  2025-06-06 20:50 [PATCH 0/4] Docs: bump sphinx version to 6.2.1 John Snow
                   ` (3 preceding siblings ...)
  2025-06-06 20:50 ` [PATCH 4/4] MAINTAINERS: Add docs/requirements.txt John Snow
@ 2025-06-11 17:01 ` John Snow
  2025-06-24  6:26 ` Markus Armbruster
  5 siblings, 0 replies; 9+ messages in thread
From: John Snow @ 2025-06-11 17:01 UTC (permalink / raw)
  To: qemu-devel, Paolo Bonzini, Daniel Berrangé, Peter Maydell
  Cc: Akihiko Odaki, Cleber Rosa

[-- Attachment #1: Type: text/plain, Size: 2789 bytes --]

On Fri, Jun 6, 2025 at 4:50 PM John Snow <jsnow@redhat.com> wrote:

> This is a re-send of Akihiko Odaki's series, rebased and altered to cope
> with the new QAPI static analysis tests now running on GitLab CI.
>
> Changes in this "v1":
>
>  - Update python static analysis testing configuration to work with the
>    new Sphinx minimum version
>  - Small adjustments to qapi_domain.py in light of upstream changes to
>    keep new CI tests passing.
>    (Thank you for deleting compat.py, Odaki-san!)
>  - Make the minimum versions for sphinx and sphinx-rtd-theme more
>    explicit, including the patch version number; thiis is *required* for
>    Debian platforms which ship sphinx-rtd-theme 1.2.1 and will fail to
>    build docs otherwise.
>
> Akihiko Odaki (3):
>   docs: Bump sphinx to 6.2.1
>   docs: Require sphinx>=6.2
>   MAINTAINERS: Add docs/requirements.txt
>
> John Snow (1):
>   python: update requirements for Sphinx
>
>  MAINTAINERS                |   1 +
>  docs/requirements.txt      |   4 +-
>  docs/sphinx/compat.py      | 230 -------------------------------------
>  docs/sphinx/qapi_domain.py |  38 +++---
>  python/setup.cfg           |   2 +-
>  python/tests/minreqs.txt   |  36 +++---
>  python/tests/qapi-isort.sh |   4 +-
>  pythondeps.toml            |   4 +-
>  8 files changed, 46 insertions(+), 273 deletions(-)
>  delete mode 100644 docs/sphinx/compat.py
>
> --
> 2.48.1
>
>
Markus is on vacation, so it'd be nice to get some input from some of the
other key maintainers before I take this.

For recap, the issue at hand here is that our preferred version of Sphinx,
5.3.0, is not compatible with Python 3.13 - so if you run configure without
a good Sphinx version, python/scripts/mkvenv.py will attempt to install a
bad version.

This series then does three closely related things:

(1) Update our preferred version of Sphinx to 6.2.1, which should work with
the latest Python versions
(2) Update our *minimum* version of Sphinx to 6.2.1, which allows us to
delete a lot of compatibility crud for Sphinx, which possibly has some
implications for the other Sphinx issues we've been having concerning
duplicate label warnings (I don't know for sure, I haven't tracked that one
as closely.)
(3) Updates the python testing venv to match the above change.

Where I am not fully confident this change will be without problems is the
fact that Debian (and likely some versions of RHEL/SUSE we still support)
do not ship with >= 6.2.1, which may introduce complications for docs in
certain scenarios, particularly for offline/isolated builds of QEMU. Please
refer to my email "Build platform guarantees, docs, tests, and snakes in
the garden" for more detail on concerns there.

Thanks,
--js

[-- Attachment #2: Type: text/html, Size: 3444 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 0/4] Docs: bump sphinx version to 6.2.1
  2025-06-06 20:50 [PATCH 0/4] Docs: bump sphinx version to 6.2.1 John Snow
                   ` (4 preceding siblings ...)
  2025-06-11 17:01 ` [PATCH 0/4] Docs: bump sphinx version to 6.2.1 John Snow
@ 2025-06-24  6:26 ` Markus Armbruster
  5 siblings, 0 replies; 9+ messages in thread
From: Markus Armbruster @ 2025-06-24  6:26 UTC (permalink / raw)
  To: John Snow; +Cc: qemu-devel, Peter Maydell, Akihiko Odaki, Cleber Rosa

John Snow <jsnow@redhat.com> writes:

> This is a re-send of Akihiko Odaki's series, rebased and altered to cope
> with the new QAPI static analysis tests now running on GitLab CI.

Works fine for me on a Fedora 41 box (Sphinx 7.3.8)

Tested-by: Markus Armbruster <armbru@redhat.com>



^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2025-06-24  6:27 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-06 20:50 [PATCH 0/4] Docs: bump sphinx version to 6.2.1 John Snow
2025-06-06 20:50 ` [PATCH 1/4] python: update requirements for Sphinx John Snow
2025-06-08  5:26   ` Akihiko Odaki
2025-06-09 19:07     ` John Snow
2025-06-06 20:50 ` [PATCH 2/4] docs: Bump sphinx to 6.2.1 John Snow
2025-06-06 20:50 ` [PATCH 3/4] docs: Require sphinx>=6.2 John Snow
2025-06-06 20:50 ` [PATCH 4/4] MAINTAINERS: Add docs/requirements.txt John Snow
2025-06-11 17:01 ` [PATCH 0/4] Docs: bump sphinx version to 6.2.1 John Snow
2025-06-24  6:26 ` Markus Armbruster

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).