.travis.yml 5.66 KB
Newer Older
1
os: linux
2
language: python
3

4 5 6 7 8 9
addons:
  apt:
    packages:
      - gdb
      - python-dbg
      - python3-dbg
10
      - libzmq-dev  # needed by IPython/Tornado
11 12
      #- gcc-8
      #- g++-8
13

14 15 16 17 18
cache:
  pip: true
  directories:
    - $HOME/.ccache

19 20 21
python:
  - 3.8
  - 2.7
22
  - 3.9-dev
23 24 25 26 27
  - 3.7
  - 3.6
  - 3.5
  - 3.4

28
env:
29 30 31 32
  global:
    - USE_CCACHE=1
    - CCACHE_SLOPPINESS=pch_defines,time_macros
    - CCACHE_COMPRESS=1
33
    - CCACHE_MAXSIZE=250M
34
    - PATH="/usr/lib/ccache:$HOME/miniconda/bin:$PATH"
35
    - BACKEND=c,cpp
36 37 38
  matrix:
    - BACKEND=c
    - BACKEND=cpp
39

40 41
matrix:
  include:
42
    # slowest first
43
    - os: osx
44 45
      osx_image: xcode10.3
      env: PY=2 MACOSX_DEPLOYMENT_TARGET=10.9
46 47 48 49 50
      python: 2
      language: c
      compiler: clang
      cache: false
    - os: osx
51
      osx_image: xcode10.3
52
      env: PY=3 MACOSX_DEPLOYMENT_TARGET=10.9
53 54 55 56
      python: 3
      language: c
      compiler: clang
      cache: false
57 58 59 60 61 62 63 64 65 66 67
# Disabled: coverage analysis takes excessively long, several times longer than without.
#    - python: 3.7
#      env: COVERAGE=1
    - python: 3.7
      env: TEST_CODE_STYLE=1
    - python: 3.8
      env: LIMITED_API=--limited-api EXCLUDE=--no-file
    - python: 3.7
      env: LIMITED_API=--limited-api EXCLUDE=--no-file
    - python: 3.6
      env: LIMITED_API=--limited-api EXCLUDE=--no-file
68
    - env: STACKLESS=true BACKEND=c PY=2
69
      python: 2.7
70
    - env: STACKLESS=true BACKEND=c PY=3
71
      python: 3.6
72 73 74 75
    - python: pypy
      env: BACKEND=c
    - python: pypy3
      env: BACKEND=c
76 77
# a secondary pypy tests which is allowed to fail and which specifically
# tests known bugs
78
    - python: pypy
79
      env: BACKEND=c EXCLUDE="--listfile=tests/pypy_bugs.txt --listfile=tests/pypy2_bugs.txt bugs"
80
    - python: pypy3
81 82 83 84
      env: BACKEND=c EXCLUDE="--listfile=tests/pypy_bugs.txt bugs"
  allow_failures:
    - env: BACKEND=c EXCLUDE="--listfile=tests/pypy_bugs.txt bugs"
    - env: BACKEND=c EXCLUDE="--listfile=tests/pypy_bugs.txt --listfile=tests/pypy2_bugs.txt bugs"
85

86

87 88
before_install:
  - |
89
    if [ "$TRAVIS_OS_NAME" == "linux" ]; then
90
      # adding apt repos in travis is really fragile => retry a couple of times.
91
      for i in {1..10}; do travis_retry sudo apt-add-repository --yes 'ppa:ubuntu-toolchain-r/test' && break; sleep 2; done
92
      for i in {1..10}; do travis_retry sudo apt-get update && travis_retry sudo apt-get install --yes gcc-8  $(if [ -z "${BACKEND##*cpp*}" ]; then echo -n "g++-8"; fi ) && break; sleep 2; done
93
      sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-8 60 $(if [ -z "${BACKEND##*cpp*}" ]; then echo " --slave /usr/bin/g++ g++ /usr/bin/g++-8"; fi)
94
      sudo update-alternatives --set gcc /usr/bin/gcc-8
95
      export CC=gcc
96
      if [ -z "${BACKEND##*cpp*}" ]; then sudo update-alternatives --set g++ /usr/bin/g++-8; export CXX=g++; fi
xoviat's avatar
xoviat committed
97 98
    fi

99
  - |
100 101
    if [ "$TRAVIS_OS_NAME" == "osx" -o "$STACKLESS" == "true" ]; then
      echo "Installing Miniconda"
102
      if [ "$TRAVIS_OS_NAME" == "osx" ]; then CONDA_PLATFORM=MacOSX; else CONDA_PLATFORM=Linux; fi
103 104 105
      travis_retry wget -O miniconda.sh https://repo.continuum.io/miniconda/Miniconda$PY-latest-${CONDA_PLATFORM}-x86_64.sh || exit 1
      bash miniconda.sh -b -p $HOME/miniconda && rm miniconda.sh || exit 1
      conda --version || exit 1
106
      #conda install --quiet --yes nomkl --file=test-requirements.txt --file=test-requirements-cpython.txt
107
      if [ "$TRAVIS_OS_NAME" == "osx" ]; then
108
        which clang && clang --version && export CC=clang || true
109
        which clang++ && clang++ --version && export CXX="clang++ -stdlib=libc++" || true
110
      fi
111 112
    fi

113 114
  - if [ -n "$CC" ]; then which ${CC%% *}; $CC --version; fi
  - if [ -n "$CXX" ]; then which ${CXX%% *}; $CXX --version; fi
115

116
  - if [ "$STACKLESS" == "true" ]; then
117
      conda config --add channels stackless;
118
      travis_retry conda install --quiet --yes stackless;
119 120
    fi

121
install:
122
  - python -c 'import sys; print("Python %s" % (sys.version,))'
123
  - if [ -n "${TRAVIS_PYTHON_VERSION##*-dev}" ]; then pip install -r test-requirements.txt $( [ -z "${TRAVIS_PYTHON_VERSION##pypy*}" -o -z "${TRAVIS_PYTHON_VERSION##3.[4789]*}" ] || echo " -r test-requirements-cpython.txt" ) ; fi
124
#  - CFLAGS="-O2 -ggdb -Wall -Wextra $(python -c 'import sys; print("-fno-strict-aliasing" if sys.version_info[0] == 2 else "")')" python setup.py build
125

126
before_script: ccache -s || true
127

128
script:
129
  - PYTHON_DBG="python$( python -c 'import sys; print("%d.%d" % sys.version_info[:2])' )-dbg"
130 131 132 133
  - if [ "$TEST_CODE_STYLE" = "1" ]; then
      STYLE_ARGS="--no-unit --no-doctest --no-file --no-pyregr --no-examples";
    else
      STYLE_ARGS=--no-code-style;
134
      if $PYTHON_DBG -V >&2; then CFLAGS="-O0 -ggdb" $PYTHON_DBG runtests.py -vv --no-code-style Debugger --backends=$BACKEND; fi;
135
      if [ -z "${BACKEND##*cpp*}" -a -n "${TRAVIS_PYTHON_VERSION##*-dev}" ]; then pip install pythran; fi;
136
      if [ "$BACKEND" != "cpp" -a -n "${TRAVIS_PYTHON_VERSION##2*}"  -a -n "${TRAVIS_PYTHON_VERSION##pypy*}" -a -n "${TRAVIS_PYTHON_VERSION##*-dev}" -a -n "${TRAVIS_PYTHON_VERSION##*3.4}" ]; then pip install mypy; fi;
137
    fi
138
# Need to clear the ccache? Try something like this:
139
#  - if [ -n "${BACKEND##*cpp*}" -a -z "${TRAVIS_PYTHON_VERSION##*3.4}" ]; then ccache -C || true; fi
140
  - if [ "$COVERAGE" != "1" ]; then CFLAGS="-O2 -ggdb -Wall -Wextra $(python -c 'import sys; print("-fno-strict-aliasing" if sys.version_info[0] == 2 else "")')" python setup.py build_ext -i $(python -c 'import sys; print("-j5" if sys.version_info >= (3,5) else "")'); fi
141
  - CFLAGS="-O0 -ggdb -Wall -Wextra" python runtests.py -vv $STYLE_ARGS -x Debugger --backends=$BACKEND $LIMITED_API $EXCLUDE $(if [ "$COVERAGE" == "1" ]; then echo " --coverage"; fi) $(if [ -z "$TEST_CODE_STYLE" ]; then echo " -j7 "; fi)
142
  - ccache -s || true