Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Travis-CI configuration #420

Open
wants to merge 14 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 18 additions & 32 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,9 @@
sudo: false
dist: trusty
os: linux
arch: amd64
dist: bionic
language: python

packages: &build_deps_optional
- swig
- libxml2-utils
- yum
- libaugeas-dev
- augeas-lenses
- libacl1-dev
- libssl-dev

matrix:
jobs:
include:
- env: PYTHON=2.4 NOSE_EXCLUDE_DIRS=testsuite/Testsrc/Testlib/TestServer
addons:
Expand All @@ -23,29 +15,27 @@ matrix:
apt:
sources: [deadsnakes]
packages: [python2.5, python2.5-dev, libbluetooth-dev]

- python: "2.6"
- python: "2.6"
env: WITH_OPTIONAL_DEPS=yes
- env: PYTHON=2.6 NOSE_EXCLUDE_DIRS=testsuite/Testsrc/Testlib/TestServer
addons:
apt:
packages: *build_deps_optional
sources: [deadsnakes]
packages: [python2.6, python2.6-dev]

- python: "2.7"

- python: "2.7"
env: WITH_OPTIONAL_DEPS=yes WITH_SYSTEM_SITE_PACKAGES=yes TEST_SPHINX=yes
env: WITH_OPTIONAL_DEPS=yes TEST_SPHINX=yes
virtualenv:
system_site_packages: true
addons:
apt:
packages: [*build_deps_optional, python-gamin, python-selinux]
packages: [yum, python-selinux, python-gamin]

- python: "3.5"
- python: "3.6"
env: WITH_OPTIONAL_DEPS=yes
addons:
apt:
packages: *build_deps_optional

allow_failures:
- python: "3.5"
- python: "3.6"

fast_finish: true

Expand All @@ -55,20 +45,16 @@ before_install:
install:
- testsuite/install.sh
- pip install -e .
before_script:
- pip freeze
script:
- testsuite/test.sh
after_failure:
- pip freeze

branches:
except:
- maint-1.2
- 1.1.0-stable

notifications:
irc:
if: branch = master
channels:
- "irc.freenode.org#bcfg2"
- "irc.freenode.org#bcfg2"
use_notice: true

cache:
Expand Down
58 changes: 17 additions & 41 deletions testsuite/install.sh
Original file line number Diff line number Diff line change
@@ -1,62 +1,38 @@
#!/bin/bash -ex

# install script for Travis-CI
# Update package sources
sudo apt-get update
sudo apt-get install -y libxml2-dev libxml2-utils

# Get python version
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 --index-url=https://pypi.org/simple -r testsuite/requirements-legacy.txt
elif [[ "$PYVER" == "2.6" ]]; then
pip install --index-url=https://pypi.org/simple pip==9.0.3
pip install setuptools==36.8.0 distribute==0.7.3
pip install -r testsuite/requirements.txt
else
pip install --upgrade pip
if [[ "$PYVER" == "2.7" ]]; then
pip install --upgrade 'pip<21'
else
pip install --upgrade pip
fi

pip_wheel() {
pip wheel --find-links="$HOME/.cache/wheels/" --wheel-dir="$HOME/.cache/wheels/" "$@"
pip install --no-index --find-links="$HOME/.cache/wheels/" "$@"
}

if [[ $PYVER == "2.6" ]]; then
pip_wheel -r testsuite/requirements-26.txt
pip_wheel unittest2
else
pip_wheel -r testsuite/requirements.txt

if [[ ${PYVER:0:1} == "3" ]]; then
# TODO: Move to "requirements.txt" if all the new errors are fixed.
pip_wheel 'pylint>1.4'
fi
fi
pip_wheel -r testsuite/requirements.txt

if [[ "$WITH_OPTIONAL_DEPS" == "yes" ]]; then
pip_wheel pyinotify boto pylibacl Jinja2 cherrypy nose-show-skipped \
google_compute_engine

if [[ $PYVER == "2.6" ]]; then
pip install \
--global-option='build_ext' \
--global-option='--include-dirs=/usr/include/x86_64-linux-gnu' \
m2crypto

pip_wheel 'django<1.7' 'South<0.8' 'mercurial<4.3' cheetah guppy \
'pycparser<2.19' python-augeas 'PyYAML<5.1'
else
if [[ $PYVER == "2.7" ]]; then
pip_wheel m2crypto guppy
fi

pip_wheel django mercurial cheetah3 python-augeas PyYAML
fi
sudo apt-get install -y libaugeas-dev libacl1-dev swig
pip_wheel -r testsuite/requirements-optional.txt
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
9 changes: 0 additions & 9 deletions testsuite/requirements-26.txt

This file was deleted.

15 changes: 15 additions & 0 deletions testsuite/requirements-optional.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
Jinja2
PyYAML
boto
cheetah3
cherrypy
django
google_compute_engine
guppy ; python_version<'3'
guppy3 ; python_version>='3'
m2crypto
mercurial
nose-show-skipped
pyinotify
pylibacl
python-augeas
13 changes: 9 additions & 4 deletions testsuite/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
lxml
python-daemon
lxml<4.3.0 ; python_version<'2.7'
lxml ; python_version>='2.7'
python-daemon<2.0.0 ; python_version<'2.7'
python-daemon ; python_version>='2.7'
genshi
argparse

nose
nose-exclude
mock
pylint<0.29
pylint<0.29 ; python_version<'3'
pylint ; python_version>='3'
pep8
sphinx
sphinx ; python_version>='2.7'
unittest2 ; python_version<'2.7'