[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[RFC PATCH v3 15/20] configure: add --enable-pypi and --disable-pypi
From: |
John Snow |
Subject: |
[RFC PATCH v3 15/20] configure: add --enable-pypi and --disable-pypi |
Date: |
Mon, 24 Apr 2023 16:02:43 -0400 |
In the event that there's no vendored source present and no sufficient
version of meson is found, we will attempt to connect to PyPI to install
the package ... only if '--disable-pypi' was not passed. This mechanism
is intended to replace the online functionality of the meson git submodule.
While --enable-pypi is the default, vendored source will always be
preferred when found, making PyPI a fallback. This should ensure that
configure-time venv building "just works" for almost everyone in almost
every circumstance.
Signed-off-by: John Snow <jsnow@redhat.com>
---
configure | 15 ++++++++++++++-
1 file changed, 14 insertions(+), 1 deletion(-)
diff --git a/configure b/configure
index e9947369b2..7421bb8364 100755
--- a/configure
+++ b/configure
@@ -623,6 +623,7 @@ check_py_version() {
}
python=
+pypi="enabled"
first_python=
if test -z "${PYTHON}"; then
# A bare 'python' is traditionally python 2.x, but some distros
@@ -883,6 +884,10 @@ for opt do
--with-git-submodules=*)
git_submodules_action="$optarg"
;;
+ --disable-pypi) pypi="disabled"
+ ;;
+ --enable-pypi) pypi="enabled"
+ ;;
--enable-plugins) if test "$mingw32" = "yes"; then
error_exit "TCG plugins not currently supported on
Windows platforms"
else
@@ -1098,7 +1103,9 @@ target_python=$python
# Defaults assumed for now:
# - venv is cleared if it exists already;
# - venv is allowed to use system packages;
-# - all setup is performed **offline**;
+# - all setup can be performed offline;
+# - missing packages may be fetched from PyPI,
+# unless --disable-pypi is passed.
# - pip is not installed into the venv when possible,
# but ensurepip is called as a fallback when necessary.
@@ -1114,7 +1121,13 @@ fi
python="$python -B"
+mkvenv_flags=""
+if test "$pypi" = "enabled" ; then
+ mkvenv_flags="--online"
+fi
+
if ! $python "${source_path}/python/scripts/mkvenv.py" ensure \
+ $mkvenv_flags \
--dir "${source_path}/python/wheels" \
"meson>=0.61.5" ;
then
--
2.39.2
- [RFC PATCH v3 02/20] python: add mkvenv.py, (continued)
- [RFC PATCH v3 02/20] python: add mkvenv.py, John Snow, 2023/04/24
- [RFC PATCH v3 08/20] mkvenv: add ensure subcommand, John Snow, 2023/04/24
- [RFC PATCH v3 07/20] mkvenv: add nested venv workaround, John Snow, 2023/04/24
- [RFC PATCH v3 10/20] tests/vm: Configure netbsd to use Python 3.10, John Snow, 2023/04/24
- [RFC PATCH v3 09/20] tests/docker: add python3-venv dependency, John Snow, 2023/04/24
- [RFC PATCH v3 11/20] tests/vm: add py310-expat to NetBSD, John Snow, 2023/04/24
- [RFC PATCH v3 13/20] configure: create a python venv unconditionally, John Snow, 2023/04/24
- [RFC PATCH v3 15/20] configure: add --enable-pypi and --disable-pypi,
John Snow <=
- [RFC PATCH v3 12/20] scripts/make-release: download meson==0.61.5 .whl, John Snow, 2023/04/24
- [RFC PATCH v3 14/20] configure: use 'mkvenv ensure meson' to bootstrap meson, John Snow, 2023/04/24
- [RFC PATCH v3 01/20] python: update pylint configuration, John Snow, 2023/04/24
- [RFC PATCH v3 16/20] tests: Use configure-provided pyvenv for tests, John Snow, 2023/04/24
- [RFC PATCH v3 17/20] configure: move --enable-docs and --disable-docs back to configure, John Snow, 2023/04/24
- [RFC PATCH v3 19/20] configure: use --diagnose option with meson ensure, John Snow, 2023/04/24