qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 0/2] configure: Check that sphinx-build is using Python 3


From: Peter Maydell
Subject: [PATCH 0/2] configure: Check that sphinx-build is using Python 3
Date: Mon, 3 Feb 2020 13:25:31 +0000

We want to assume that all the Python we write is running
with at least Python 3.5; configure checks that for our scripts, but
Sphinx extensions run with whatever Python version sphinx-build
itself is using. At the moment our Sphinx extensions all work under
Python 2, but the one I'm working on for handling parsing QAPI docs
out of the JSON is going to want to include some of the scripts/qapi
Python which is more complicated and definitely now 3-only.  In any
case, allowing some bits of our Python code to run under Python 2
is setting a beartrap for our future selves. It's nicer to fail
cleanly rather than let users stumble into corner cases we don't
test and don't want to support even if they happen to work today.

Patch 1 adds a --sphinx-build=/path/to/binary option, so that
if the user has a system where the default 'sphinx-build' on
the $PATH is Python 2 they can tell configure to use a different one.

Patch 2 makes the Sphinx conf.py fail for old Pythons, and
makes configure handle and present the error to the user.

Alex: do you have a way to test this patchset with readthedocs
before it hits master? I'm not sure what version of Python
their sphinx-build is using. If we need to I think we can
force a Python version with a .readthedocs.yml file in our
git repo:
https://docs.readthedocs.io/en/stable/config-file/v2.html
but if they default to a new enough Python anyway then we
needn't bother.

thanks
-- PMM

Peter Maydell (2):
  configure: Allow user to specify sphinx-build binary
  configure: Check that sphinx-build is using Python 3

 configure    | 22 +++++++++++++++++++---
 Makefile     |  2 +-
 docs/conf.py | 10 ++++++++++
 3 files changed, 30 insertions(+), 4 deletions(-)

-- 
2.20.1




reply via email to

[Prev in Thread] Current Thread [Next in Thread]