From 5fc1f7e3a561b3becd2ca2fb1bb13a1a7a083021 Mon Sep 17 00:00:00 2001 From: Alexander Sulfrian Date: Thu, 17 Aug 2017 21:32:52 +0200 Subject: [PATCH] travis-ci: Fix "with_system_site_packages" The "with_system_site_packages" virtualenv seems to be missing the pymodules directory containing python modules installed with the python-support debian helper. So we use the default environment and manually add the references to the system-wide python packages. --- .travis.yml | 4 ++-- testsuite/install.sh | 10 ++++++++++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 022201babb..af365b9d94 100644 --- a/.travis.yml +++ b/.travis.yml @@ -32,8 +32,8 @@ matrix: packages: *build_deps_optional - python: "2.7" - - python: "2.7_with_system_site_packages" - env: WITH_OPTIONAL_DEPS=yes TEST_SPHINX=yes + - python: "2.7" + env: WITH_OPTIONAL_DEPS=yes WITH_SYSTEM_SITE_PACKAGES=yes TEST_SPHINX=yes addons: apt: packages: [*build_deps_optional, python-gamin, python-selinux] diff --git a/testsuite/install.sh b/testsuite/install.sh index 01c5199f2d..af07de0a94 100755 --- a/testsuite/install.sh +++ b/testsuite/install.sh @@ -2,6 +2,7 @@ # install script for Travis-CI PYVER=$(python -c 'import sys;print(".".join(str(v) for v in sys.version_info[0:2]))') +SITE_PACKAGES=$(python -c 'from distutils.sysconfig import get_python_lib; print(get_python_lib())') if [[ ${PYVER:0:1} == "2" && $PYVER != "2.7" && $PYVER != "2.6" ]]; then pip install -r testsuite/requirements-legacy.txt @@ -46,6 +47,15 @@ else fi fi +# Use system site-packages and pymodules +if [[ "$WITH_SYSTEM_SITE_PACKAGES" == "yes" ]]; then + cat < "$SITE_PACKAGES/system-packages.pth" +/usr/lib/python$PYVER/site-packages/ +/usr/lib/python$PYVER/dist-packages/ +/usr/lib/pymodules/python$PYVER/ +EOF +fi + # Setup the local xml schema cache download_schema() { if [[ ! -e "$1" ]]; then