[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 05/10] configure: Look for auxiliary Python installations
From: |
Daniel P . Berrangé |
Subject: |
Re: [PATCH 05/10] configure: Look for auxiliary Python installations |
Date: |
Wed, 22 Feb 2023 15:19:40 +0000 |
User-agent: |
Mutt/2.2.9 (2022-11-12) |
On Wed, Feb 22, 2023 at 03:37:47PM +0100, Paolo Bonzini wrote:
> From: John Snow <jsnow@redhat.com>
>
> At the moment, we look for just "python3" and "python", which is good
> enough almost all of the time. But ... if you are on a platform that
> uses an older Python by default and only offers a newer Python as an
> option, you'll have to specify --python=/usr/bin/foo every time.
>
> We can be kind and instead make a cursory attempt to locate a suitable
> Python binary ourselves, looking for the remaining well-known binaries.
>
> This configure loop will use whatever is specified in $PYTHON or, if
> empty, will try the following in order:
>
> 1. python3
> 2. python
> 3. python3.11 down through python3.6
>
> Notes:
>
> - Python virtual environment provides binaries for "python3", "python",
> and whichever version you used to create the venv,
> e.g. "python3.8". If configure is invoked from inside of a venv, this
> configure loop will not "break out" of that venv unless that venv is
> created using an explicitly non-suitable version of Python that we
> cannot use.
>
> - In the event that no suitable python is found, the first python found
> is the version used to generate the human-readable error message.
>
> - The error message isn't printed right away to allow later
> configuration code to pick up an explicitly configured python.
>
> Signed-off-by: John Snow <jsnow@redhat.com>
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
> configure | 63 ++++++++++++++++++++++++++++++++++++++++---------------
> 1 file changed, 46 insertions(+), 17 deletions(-)
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
With regards,
Daniel
--
|: https://berrange.com -o- https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org -o- https://fstop138.berrange.com :|
|: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
- [PATCH v4 0/9] improvement to Python detection, preparation for dropping 3.6, Paolo Bonzini, 2023/02/22
- [PATCH 01/10] python: support pylint 2.16, Paolo Bonzini, 2023/02/22
- [PATCH 05/10] configure: Look for auxiliary Python installations, Paolo Bonzini, 2023/02/22
- Re: [PATCH 05/10] configure: Look for auxiliary Python installations,
Daniel P . Berrangé <=
- [PATCH 02/10] python: drop pipenv, Paolo Bonzini, 2023/02/22
- [PATCH 03/10] meson: prefer 'sphinx-build' to 'sphinx-build-3', Paolo Bonzini, 2023/02/22
- [PATCH 04/10] configure: protect against escaping venv when running Meson, Paolo Bonzini, 2023/02/22
- [PATCH 08/10] ci, docker: update CentOS and OpenSUSE Python to non-EOL versions, Paolo Bonzini, 2023/02/22
- [PATCH 07/10] docs/devel: update and clarify lcitool instructions, Paolo Bonzini, 2023/02/22