forked from thadeusb/flask-cache
-
Notifications
You must be signed in to change notification settings - Fork 4
/
.travis.yml
100 lines (88 loc) · 2.49 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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
sudo: false
language: python
python:
- 3.6
- 3.7
- 3.8
- pypy3
cache:
directories:
- ~/.cache/pip
env:
matrix:
- OPTIONAL=true
- OPTIONAL=false
global:
- PIP_WHEEL_DIR=$HOME/.cache/pip/wheels
- PIP_FIND_LINKS=file://$HOME/.cache/pip/wheels
- PYTHONHASHSEED=94967295
- PYPY_GIT=https://github.com/yyuu/pyenv.git
- PYENV_VENV_GIT=https://github.com/pyenv/pyenv-virtualenv.git
- PYENV_ROOT=$HOME/.pyenv
- PYPY_VENV=$HOME/virtualenvs
- PYPY_PATH=$PYENV_ROOT/versions
- PATH="$PYENV_ROOT/shims:${PATH}"
- PATH="$PYENV_ROOT/bin:${PATH}"
matrix:
fast_finish: true
allow_failures:
- python: pypy3
notifications:
email:
on_success: always
branches:
except:
- /^v[0-9]/
before_install:
- |
if [ "$TRAVIS_PYTHON_VERSION" == "pypy3" ]; then
# https://github.com/pyenv/pyenv/tree/master/plugins/python-build/share/python-build
export PYPY_BUILD="pypy3.6-7.3.0"
export PYPY_EXEC="pypy3-v7.3.0"
fi
- |
if [[ "$TRAVIS_PYTHON_VERSION" == "pypy"* ]]; then
if [ -f "$PYENV_ROOT/bin/pyenv" ]; then
pushd "$PYENV_ROOT" && git pull && popd
else
rm -rf "$PYENV_ROOT" && git clone --depth 1 "$PYPY_GIT" "$PYENV_ROOT"
fi
export PYENV_VERSION="$PYPY_BUILD"
git clone "$PYENV_VENV_GIT" "$PYENV_ROOT"/plugins/pyenv-virtualenv
eval "$(pyenv init -)"
pyenv deactivate
pyenv install --skip-existing "$PYENV_VERSION"
pyenv global "$PYENV_VERSION"
pyenv virtualenv "$PYENV_VERSION" "$PYPY_EXEC"
pyenv activate "$PYPY_EXEC"
python --version
pip --version
fi
install:
- pip install -U pip
- pip install wheel
- pip install -r dev-requirements.txt
- pip install -r requirements.txt
- |
if [[ "$OPTIONAL" == "true" ]]; then
if [[ "$TRAVIS_PYTHON_VERSION" == "pypy"* ]]; then
while read line; do
if [[ $line != pylibmc* ]]; then
pip wheel "$line"
pip install "$line"
fi
done < optional-requirements.txt
else
pip wheel -r optional-requirements.txt
pip install -r optional-requirements.txt
fi
fi
script:
- manage lint && manage test --cover
services:
- memcached
- redis-server
after_success:
- if [[ "$TRAVIS_PULL_REQUEST" == "true" ]]; then exit 0; fi
- if [[ "$TRAVIS_BRANCH" != "master" ]]; then exit 0; fi
- if [[ "$TRAVIS_PYTHON_VERSION" != "2.7" ]]; then exit 0; fi