qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] docs/conf.py: Remove usage of distutils
@ 2024-03-04 13:04 Thomas Huth
  2024-03-04 13:09 ` Michael Tokarev
                   ` (3 more replies)
  0 siblings, 4 replies; 13+ messages in thread
From: Thomas Huth @ 2024-03-04 13:04 UTC (permalink / raw)
  To: qemu-devel, Peter Maydell; +Cc: qemu-stable, Daniel P . Berrangé

The macOS jobs in our CI recently started failing, complaining that
the distutils module is not available anymore. And indeed, according to
https://peps.python.org/pep-0632/ it's been deprecated since a while
and now likely got removed in recent Python versions.

Fortunately, we only use it for a version check via LooseVersion here
which we don't really need anymore - according to Repology.org, these
are the versions of sphinx-rtd-theme that are currently used by the
various distros:

 centos_stream_8: 0.3.1
 centos_stream_9: 0.5.1
 fedora_38: 1.1.1
 fedora_39: 1.2.2
 freebsd: 1.0.0
 haikuports_master: 1.2.1
 openbsd: 1.2.2
 opensuse_leap_15_5: 0.5.1
 pkgsrc_current: 2.0.0
 debian_11: 0.5.1
 debian_12: 1.2.0
 ubuntu_20_04: 0.4.3
 ubuntu_22_04: 1.0.0
 ubuntu_24_04: 2.0.0

So except for CentOS 8, all distros are using a newer version of
sphinx-rtd-theme, and for CentOS 8 we don't support compiling with
the Sphinx of the distro anymore anyway, since it's based on the
Python 3.6 interpreter there. For compiling on CentOS 8, you have
to use the alternative Python 3.8 interpreter which comes without
Sphinx, so that needs the Sphinx installed via pip in the venv
instead, and that is using a newer version, too, according to our
pythondeps.toml file.

Thus we can simply drop the version check now to get rid of the
distutils dependency here.

Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 v2: Updated the commit description (it's about sphinx-rtd-theme,
     not the Sphinx program itself)

 docs/conf.py | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/docs/conf.py b/docs/conf.py
index e84a95e71c..1b2afa241c 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -29,7 +29,6 @@
 import os
 import sys
 import sphinx
-from distutils.version import LooseVersion
 from sphinx.errors import ConfigError
 
 # The per-manual conf.py will set qemu_docdir for a single-manual build;
@@ -165,11 +164,10 @@
 # Theme options are theme-specific and customize the look and feel of a theme
 # further.  For a list of options available for each theme, see the
 # documentation.
-if LooseVersion(sphinx_rtd_theme.__version__) >= LooseVersion("0.4.3"):
-    html_theme_options = {
-        "style_nav_header_background": "#802400",
-        "navigation_with_keys": True,
-    }
+html_theme_options = {
+    "style_nav_header_background": "#802400",
+    "navigation_with_keys": True,
+}
 
 html_logo = os.path.join(qemu_docdir, "../ui/icons/qemu_128x128.png")
 
-- 
2.44.0



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

end of thread, other threads:[~2024-03-10 14:11 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-03-04 13:04 [PATCH v2] docs/conf.py: Remove usage of distutils Thomas Huth
2024-03-04 13:09 ` Michael Tokarev
2024-03-04 13:10 ` Thomas Huth
2024-03-04 16:56 ` Peter Maydell
2024-03-04 17:11   ` Thomas Huth
2024-03-04 18:04     ` Daniel P. Berrangé
2024-03-05 10:39       ` Thomas Huth
2024-03-09 17:27         ` Peter Maydell
2024-03-09 18:29           ` Philippe Mathieu-Daudé
2024-03-09 20:15             ` Peter Maydell
2024-03-10 14:10           ` Peter Maydell
2024-03-04 21:15 ` Alex Bennée
2024-03-05  9:44   ` Peter Maydell

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).