qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] configure: Check that sphinx-build is using Python 3
@ 2020-02-03 13:25 Peter Maydell
  2020-02-03 13:25 ` [PATCH 1/2] configure: Allow user to specify sphinx-build binary Peter Maydell
  2020-02-03 13:25 ` [PATCH 2/2] configure: Check that sphinx-build is using Python 3 Peter Maydell
  0 siblings, 2 replies; 9+ messages in thread
From: Peter Maydell @ 2020-02-03 13:25 UTC (permalink / raw)
  To: qemu-devel; +Cc: Alex Bennée


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



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

end of thread, other threads:[~2020-02-04 13:59 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-02-03 13:25 [PATCH 0/2] configure: Check that sphinx-build is using Python 3 Peter Maydell
2020-02-03 13:25 ` [PATCH 1/2] configure: Allow user to specify sphinx-build binary Peter Maydell
2020-02-03 18:08   ` Alex Bennée
2020-02-04 10:39   ` Markus Armbruster
2020-02-04 12:37     ` Paolo Bonzini
2020-02-04 13:53   ` Wainer dos Santos Moschetta
2020-02-03 13:25 ` [PATCH 2/2] configure: Check that sphinx-build is using Python 3 Peter Maydell
2020-02-03 18:09   ` Alex Bennée
2020-02-04 13:58   ` Wainer dos Santos Moschetta

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