]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
doc/_ext: import status_iterator from sphinx.util.display
authorKefu Chai <tchaikov@gmail.com>
Tue, 24 Jun 2025 23:49:25 +0000 (07:49 +0800)
committerKefu Chai <tchaikov@gmail.com>
Wed, 25 Jun 2025 00:24:19 +0000 (08:24 +0800)
Import status_iterator from sphinx.util.display with fallback to sphinx.util
for backward compatibility.

The status_iterator function was moved from sphinx.util to sphinx.util.display
in Sphinx 6.1 and the old import path was removed in Sphinx 8.0. See
https://www.sphinx-doc.org/en/master/extdev/deprecated.html. Since our CI
and packaging environments use older Sphinx versions (Ubuntu Jammy ships 4.3.2,
CentOS ships 3.4.3), we need to maintain compatibility with both old and new
Sphinx versions.

This change ensures the documentation builds successfully across all supported
Sphinx versions by attempting the new import path first, then falling back to
the legacy path if needed.

Signed-off-by: Kefu Chai <tchaikov@gmail.com>
doc/_ext/ceph_confval.py

index 3a1a9b8abeafdd73fc7327a19e49cdcdf3ed51af..c5e212173f18b9870d42db7a57434ff88f85227b 100644 (file)
@@ -11,7 +11,11 @@ from docutils.statemachine import StringList
 from sphinx import addnodes
 from sphinx.directives import ObjectDescription
 from sphinx.locale import _
-from sphinx.util import logging, status_iterator, ws_re
+from sphinx.util import logging, ws_re
+try:
+    from sphinx.util.display import status_iterator
+except ImportError:
+    from sphinx.util import status_iterator
 from sphinx.util.docutils import switch_source_input, SphinxDirective
 from sphinx.util.docfields import Field
 from sphinx.util.nodes import make_id