diff options
| author | Jeffery To <jeffery.to@gmail.com> | 2023-02-20 19:10:39 +0800 |
|---|---|---|
| committer | Josef Schlehofer <pepe.schlehofer@gmail.com> | 2023-10-13 08:23:39 +0200 |
| commit | 19e6300f0cdbb1c048f65d16875357a3b099c8c6 (patch) | |
| tree | e388c06ed531192e2837e0bf908c2b4172a3fb3d /lang/python/python3-host.mk | |
| parent | b5ccf456dfcde07254b9021102c7025e3197b9df (diff) | |
python: Better host pip options
pip by default will read system-wide and per-user configuration
files[1]. Setting PIP_CONFIG_FILE=/dev/null instructs pip to not read
any config files[2].
pip will spawn child processes of itself to do work, but not all options
are passed down to the child processes[3]. Setting global options as
environment variables[4] ensures they are passed down to any child
processes.
[1]: https://pip.pypa.io/en/stable/topics/configuration/#configuration-files
[2]: https://pip.pypa.io/en/stable/topics/configuration/#pip-config-file
[3]: https://github.com/pypa/pip/issues/9081#issue-733819665
[4]: https://pip.pypa.io/en/stable/topics/configuration/#environment-variables
Signed-off-by: Jeffery To <jeffery.to@gmail.com>
(cherry picked from commit 8c2abb74031e2403dde83536a8e7f13c63cdd4ab)
Diffstat (limited to 'lang/python/python3-host.mk')
| -rw-r--r-- | lang/python/python3-host.mk | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/lang/python/python3-host.mk b/lang/python/python3-host.mk index 8dc5e732f..54f9bde1e 100644 --- a/lang/python/python3-host.mk +++ b/lang/python/python3-host.mk @@ -93,6 +93,11 @@ HOST_PYTHON3_PIP:=$(STAGING_DIR_HOSTPKG)/bin/pip$(PYTHON3_VERSION) HOST_PYTHON3_PIP_CACHE_DIR:=$(DL_DIR)/pip-cache +HOST_PYTHON3_PIP_VARS:= \ + PIP_CACHE_DIR="$(HOST_PYTHON3_PIP_CACHE_DIR)" \ + PIP_CONFIG_FILE=/dev/null \ + PIP_DISABLE_PIP_VERSION_CHECK=1 + define SetupPyShim if [ -f $(1)/pyproject.toml ] && [ ! -f $(1)/setup.py ] ; then \ $(CP) $(python3_mk_path)setup.py.shim $(1)setup.py ; \ @@ -104,11 +109,11 @@ endef define HostPython3/PipInstall $(call locked, \ $(HOST_PYTHON3_VARS) \ + $(HOST_PYTHON3_PIP_VARS) \ $(HOST_PYTHON3_PIP) \ - --cache-dir "$(HOST_PYTHON3_PIP_CACHE_DIR)" \ - --disable-pip-version-check \ install \ --no-binary :all: \ + --progress-bar off \ --require-hashes \ $(1) \ $(if $(CONFIG_PYTHON3_HOST_PIP_CACHE_WORLD_READABLE), \ |
