Skip to content

Commit

Permalink
travis-ci: Fix "with_system_site_packages"
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
AlexanderS committed Aug 17, 2017
1 parent cf92b09 commit 5fc1f7e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
10 changes: 10 additions & 0 deletions testsuite/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -46,6 +47,15 @@ else
fi
fi

# Use system site-packages and pymodules
if [[ "$WITH_SYSTEM_SITE_PACKAGES" == "yes" ]]; then
cat <<EOF > "$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
Expand Down

0 comments on commit 5fc1f7e

Please sign in to comment.