[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 02/29] configure: Check that sphinx-build is using Python 3
From: |
Peter Maydell |
Subject: |
Re: [PATCH 02/29] configure: Check that sphinx-build is using Python 3 |
Date: |
Fri, 7 Feb 2020 16:30:52 +0000 |
On Fri, 7 Feb 2020 at 16:18, Markus Armbruster <address@hidden> wrote:
>
> Peter Maydell <address@hidden> writes:
>
> > Currently configure's has_sphinx_build() check simply runs a dummy
> > sphinx-build and either passes or fails. This means that "no
> > sphinx-build at all" and "sphinx-build exists but is too old" are
> > both reported the same way.
> >
> > Further, 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.
> >
> > Add a check to our conf.py which makes sphinx-build fail if it would
> > be running our extensions with an old Python, and handle this
> > in configure so we can report failure helpfully to the user.
> > This will mean that configure --enable-docs will fail like this
> > if the sphinx-build provided is not suitable:
> >
> > Warning: sphinx-build exists but it is either too old or uses too old a
> > Python version
> >
> > ERROR: User requested feature docs
> > configure was not able to find it.
> > Install texinfo, Perl/perl-podlators and a Python 3 version of
> > python-sphinx
> >
> > (As usual, the default is to simply not build the docs, as we would
> > if sphinx-build wasn't present at all.)
> >
> > Signed-off-by: Peter Maydell <address@hidden>
> > Reviewed-by: Alex Bennée <address@hidden>
> > Reviewed-by: Wainer dos Santos Moschetta <address@hidden>
> > ---
> > configure | 12 ++++++++++--
> > docs/conf.py | 10 ++++++++++
> > 2 files changed, 20 insertions(+), 2 deletions(-)
> >
> > diff --git a/configure b/configure
> > index 0aceb8e50db..2c5cad13edd 100755
> > --- a/configure
> > +++ b/configure
>
> Any particular reason for having $sphinx_build default to the
> indeterminate version sphinx-build rather than sphinx-build-3?
Because that's the binary we were using before this patch.
"Allow the user to specify" shouldn't be tangled up with
"and also change the default".
It might be sphinx-build-3 on RH, but on Debian/Ubuntu it's
just 'sphinx-build' assuming you installed the python3-sphinx
and not the python2-sphinx, or you can run it directly out of
/usr/share/sphinx/scripts/python3/sphinx-build, or (like
me) you might have a locally installed 'sphinx-build' which
is using Python 3. My assumption is that once the python2->3
transition has faded into the rear view mirror most distros
will just have a /usr/bin/sphinx-build that's a Python 3 one.
thanks
-- PMM
[PATCH 03/29] Makefile: Fix typo in dependency list for interop manpages, Peter Maydell, 2020/02/06
[PATCH 04/29] qga/qapi-schema.json: Fix missing '-' in GuestDiskBusType doc comment, Peter Maydell, 2020/02/06
[PATCH 05/29] qga/qapi-schema.json: Fix indent level on doc comments, Peter Maydell, 2020/02/06
[PATCH 06/29] qga/qapi-schema.json: minor format fixups for rST, Peter Maydell, 2020/02/06