Skip to content

configure: Check that sphinx-build is using Python 3

Peter Maydell qemu-devel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 6 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2configure: Allow user to specify sphinx-build binaryMakefile configure+10 -24 replies
2/2configure: Check that sphinx-build is using Python 3configure docs/conf.py+20 -22 replies

Reviews trailers per patch

All 2 patches have a Reviewed-by or Acked-by.

PatchAlex BennéeWainer dos Santos Moschetta
1/2R-b R-b
2/2R-b R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

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

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(-)
Signature · 1 line
2.20.1