Add a CEPH_PYTHON_SYSTEM_SITE switch (off by default). When set:
- setup-virtualenv.sh builds its venv with --system-site-packages;
- run_tox.sh exports VIRTUALENV_SYSTEM_SITE_PACKAGES=true for tox's venvs.
This lets distro packages satisfy test dependencies instead of pip building
them from sdist, which helps where prebuilt wheels are missing (e.g. scipy and
numpy on riscv64) by avoiding a slow rebuild when the RPMs are installed.
Signed-off-by: Sun Yuechi <sunyuechi@iscas.ac.cn>
export CEPH_BUILD_DIR=$build_dir
# use the wheelhouse prepared by install-deps.sh
export PIP_FIND_LINKS="$tox_path/wheelhouse"
+ # CEPH_PYTHON_SYSTEM_SITE (default off): let tox's venvs see system site-packages
+ if ${CEPH_PYTHON_SYSTEM_SITE:-false}; then
+ export VIRTUALENV_SYSTEM_SITE_PACKAGES=true
+ fi
tox_cmd=(tox -c $tox_path/tox.ini)
if [ "$tox_envs" != "__tox_defaults__" ]; then
tox_cmd+=("-e" "$tox_envs")
fi
rm -fr $DIR
mkdir -p $DIR
-$PYTHON -m venv $DIR
+# CEPH_PYTHON_SYSTEM_SITE (default off): build venv against system site-packages
+VENV_OPTS=
+if ${CEPH_PYTHON_SYSTEM_SITE:-false}; then
+ VENV_OPTS="--system-site-packages"
+fi
+$PYTHON -m venv $VENV_OPTS $DIR
. $DIR/bin/activate
if pip --help | grep -q disable-pip-version-check; then