summaryrefslogtreecommitdiff
path: root/.travis.yml
blob: 0b50a2714a0800d9bfae23f50f2e8d0f739488df (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
language: python
cache: pip
python:
  - "2.7"
  - "3.4"
  - "3.5"
  - "3.6"
  - "3.7"
  - "3.8"
  - "3.9-dev"
  - "nightly"
env: TOXENV=py

matrix:
  fast_finish: true
  include:
    - python: 3.3
      # This is required to run Python 3.3 on Travis
      dist: trusty
      env: TOXENV=py33 # Needed because "py" won't invoke testenv:py33
    - python: 3.6
      env: TOXENV=docs
    - python: 3.6
      env: TOXENV=tz
    - python: 3.7
      env: TOXENV=build
  allow_failures:
    - python: "nightly"

install:
  - |
    if [[ $TRAVIS_PYTHON_VERSION == "3.3" ]]; then
      pip install -U "pip==10.0.1"
      PIP_ARGS="-c requirements/3.3/constraints.txt"
    fi
  - pip install -U "tox<3.8.0" $PIP_ARGS
  - if [[ $TOXENV == "py" ]]; then ./ci_tools/retry.sh python updatezinfo.py; fi

script:
  - tox
  - |
    if [[ $TOXENV == "build" ]]; then
      exactly_one() {
        value=$(find dist -iname $1 | wc -l)
        if [ $value -ne 1 ]; then
          echo "Found $value instances of $1, not 1"
          return 1
        else
          echo "Found exactly 1 instance of $value"
        fi
      }

      # Check that exactly one tarball and one wheel are created
      exactly_one '*.tar.gz'
      exactly_one '*.whl'
    fi

after_success:
  - if [[ $TOXENV == "py" ]]; then tox -e coverage,codecov; fi