forked from mypyc/mypyc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
78 lines (70 loc) · 2.02 KB
/
.travis.yml
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
language: python
cache: pip
cache:
directories:
- $HOME/python-debug
- $HOME/.pyenv/versions
- $HOME/Library/Caches/pip
matrix:
include:
- os: linux
sudo: false
python: "3.5"
env: PYTHON_DEBUG_BUILD=0
- os: linux
sudo: false
python: "3.6"
env: PYTHON_DEBUG_BUILD=0
- os: linux
sudo: false
python: "3.6"
env: PYTHON_DEBUG_BUILD=1
- os: osx
osx_image: xcode8.3
language: generic
env: PYTHONVERSION=3.6.3
before_install: |
set -e
if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
export PYTHONVERSION=`python --version | awk '{ print $2 }'`
if [[ $PYTHON_DEBUG_BUILD == 1 ]]; then
export PYTHONDIR=~/python-debug/python-$PYTHONVERSION
else
export PYTHONDIR="/opt/python/$PYTHONVERSION"
fi
if [[ $PYTHON_DEBUG_BUILD == 1 ]]; then
VENV=$PYTHONDIR/env
scripts/build-debug-python.sh $PYTHONVERSION $PYTHONDIR $VENV
source $VENV/bin/activate
fi
elif [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
# Attempt to install, skipping if version already exists.
pyenv install $PYTHONVERSION -s
# Regenerate shims
pyenv rehash
# Manually set pyenv variables per https://pythonhosted.org/CodeChat/.travis.yml.html
export PYENV_VERSION=$PYTHONVERSION
export PATH="/Users/travis/.pyenv/shims:${PATH}"
fi
# Check python install
which python
python --version
# Upgrade pip, setuptools, and wheel
pip install -U pip setuptools wheel
install:
- pip install -r external/mypy/test-requirements.txt
script: |
set -e
export PYTHONPATH=`pwd`/external/mypy
if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
export PYTHONCONFIG="$PYTHONDIR/bin/python-config"
export LD_LIBRARY_PATH="$PYTHONDIR/lib"
if [[ $PYTHON_DEBUG_BUILD != 1 ]]; then
pytest -n4 mypyc
fi
if [[ $PYTHON_DEBUG_BUILD == 1 ]]; then
pytest -n4 mypyc/test/test_run.py mypyc/test/test_external.py -k 'not test_self_type_check'
fi
elif [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
pytest -n4 mypyc
fi