forked from cherrypy/cheroot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
290 lines (281 loc) · 9.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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
conditions: v1
dist: xenial
language: python
python:
- 2.7
- 3.4
- 3.5
- 3.6
- &pypy3 pypy3
env:
global:
GIT_INSTALLER_DIR_PATH: ${HOME}/.git-installers
GIT_VERSION: 2.20.1
PYTHON_INSTALLER_DIR_PATH: ${HOME}/.python-installers
_base_envs:
- &stage_lint
stage: &stage_lint_name lint
- &stage_test
stage: &stage_test_name test
- &stage_test_priority
stage: &stage_test_priority_name test against latest Python versions first (under GNU/Linux)
- &stage_test_osx
stage: &stage_test_osx_name test under OS X (last chance to fail before deploy available)
- &stage_deploy
stage: &stage_deploy_name upload new version of python package to PYPI (only for tagged commits)
- &manual_run_or_cron # run the job only if it's a cron run or it's triggered manually
if: type IN (api, cron)
- &pyenv_base
<<: *stage_test
language: generic
python: &pypy2 pypy
env:
- &env_pypy2 PYTHON_VERSION=pypy2.7-7.1.0
- &env_pyenv PYENV_ROOT="$HOME/.pyenv"
- &env_path PATH="$PYENV_ROOT/bin:$PATH"
before_install:
- &ensure_pyenv_installed |
if [ ! -f "$PYENV_ROOT/bin/pyenv" ]
then
rm -rf "$PYENV_ROOT"
curl -L https://raw.githubusercontent.com/pyenv/pyenv-installer/master/bin/pyenv-installer | bash
fi
eval "$(pyenv init -)"
eval "$(pyenv virtualenv-init -)"
pyenv update
- &install_python pyenv install --skip-existing --keep --verbose "$PYTHON_VERSION"
- &switch_python pyenv shell "$PYTHON_VERSION"
- &python_version python --version
- &python_ssl_openssl_version >-
python -c 'import ssl; print("\nOPENSSL_VERSION: " + ssl.OPENSSL_VERSION + "\nOPENSSL_VERSION_INFO: " + repr(ssl.OPENSSL_VERSION_INFO) + "\nOPENSSL_VERSION_NUMBER: " + repr(ssl.OPENSSL_VERSION_NUMBER))'
- &osx_python_base
<<: *pyenv_base
<<: *stage_test_osx
os: osx
osx_image: xcode8.3
language: generic
cache:
directories:
- $HOME/Library/Caches/Homebrew
- $PYTHON_INSTALLER_DIR_PATH
- $GIT_INSTALLER_DIR_PATH
before_install: &install-from-pyenv
- brew install zlib readline
- brew install https://raw.githubusercontent.com/Homebrew/homebrew-core/master/Formula/pyenv.rb || brew upgrade pyenv
- brew install [email protected]
- &ensure_pyenv_preloaded |
eval "$(pyenv init -)"
eval "$(pyenv virtualenv-init -)"
- *install_python
- *switch_python
- *python_version
- python -m pip install --upgrade virtualenv
- python -m pip install tox
- env CRYPTOGRAPHY_SUPPRESS_LINK_FLAGS=1 LDFLAGS="$(brew --prefix [email protected])/lib/libssl.a $(brew --prefix [email protected])/lib/libcrypto.a" CFLAGS="-I$(brew --prefix [email protected])/include" python -m tox --notest
- *python_ssl_openssl_version
before_install: &install-from-python_org
- |
function probe_url() {
local py_ver="$1"
[ $(curl -I --write-out '%{http_code}' --silent --output /dev/null "https://www.python.org/ftp/python/${py_ver}/python-${py_ver}-macosx10.6.pkg") == '200' ] && return 0
return 1
}
- |
function find_last_macos_py() {
for py_ver in $*
do
>&2 echo Probing $py_ver
probe_url $py_ver && >&2 echo "Found pkg: ${py_ver}" && echo $py_ver && return 0
done
>&2 echo Failed looking up macOS pkg for $*
return 1
}
- export GIT_DMG_NAME="git-${GIT_VERSION}-intel-universal-mavericks.dmg"
- export GIT_PKG_NAME="git-${GIT_VERSION}-intel-universal-mavericks.pkg"
- export GIT_DMG_PATH="${GIT_INSTALLER_DIR_PATH}/${GIT_DMG_NAME}"
- >
stat "${GIT_DMG_PATH}" &>/dev/null || wget -O "${GIT_DMG_PATH}" "https://sourceforge.net/projects/git-osx-installer/files/${GIT_DMG_NAME}/download?use_mirror=autoselect"
- stat "${GIT_DMG_PATH}" >/dev/null
- sudo hdiutil attach ${GIT_DMG_PATH}
- hdiutil info
- >
export GIT_INSTALLER_VOLUME=$(hdiutil info | tail -n1 | sed 's#^.*\(/Volumes.*\)#\1#')
- >
export GIT_INSTALLER_PATH="${GIT_INSTALLER_VOLUME}/${GIT_PKG_NAME}"
- ls -alh "${GIT_INSTALLER_VOLUME}"
- sudo installer -verboseR -dumplog -pkg "${GIT_INSTALLER_PATH}" -target /
- sudo hdiutil detach "${GIT_INSTALLER_VOLUME}"
- export PYTHON_VERSION_LONG_SUGGESTIONS=$(git ls-remote --sort -v:refname --tags git://github.com/python/cpython.git "${PYTHON_VERSION}*" "v${PYTHON_VERSION}*" | grep -v '\^{}$' | awk '{print$2}' | sed 's#^refs/tags/##;s#^v##' | grep -v '[abcepr]')
- export PYTHON_VERSION_LONG=$(find_last_macos_py $PYTHON_VERSION_LONG_SUGGESTIONS)
- export PYTHON_VERSION_SHORT=$(echo ${PYTHON_VERSION_LONG} | awk -F. '{print$1"."$2}')
- echo "Selected version vars are:"
- echo "PYTHON_VERSION=${PYTHON_VERSION}"
- echo "PYTHON_VERSION_SHORT=${PYTHON_VERSION_SHORT}"
- echo "PYTHON_VERSION_LONG=${PYTHON_VERSION_LONG}"
- export PYTHON_INSTALL_PATH="/Library/Frameworks/Python.framework/Versions/${PYTHON_VERSION_SHORT}"
- export PYTHON_INSTALL_EXE="${PYTHON_INSTALL_PATH}/bin/python${PYTHON_VERSION_SHORT}"
- export PATH="${PYTHON_INSTALL_PATH}/bin:${PATH}"
- export PYTHON_VENV_PATH="${HOME}/virtualenv/python${PYTHON_VERSION_SHORT}"
- export PYTHON_INSTALLER_PATH="${PYTHON_INSTALLER_DIR_PATH}/python-${PYTHON_VERSION_LONG}.pkg"
- echo "PYTHON_INSTALLER_PATH=${PYTHON_INSTALLER_PATH}"
- env
- >
stat "${PYTHON_INSTALLER_PATH}" &>/dev/null || wget -O "${PYTHON_INSTALLER_PATH}" "https://www.python.org/ftp/python/${PYTHON_VERSION_LONG}/python-${PYTHON_VERSION_LONG}-macosx10.6.pkg"
- stat "${PYTHON_INSTALLER_PATH}" >/dev/null
- sudo installer -verboseR -dumplog -pkg "${PYTHON_INSTALLER_PATH}" -target /
- ls "${PYTHON_INSTALL_PATH}/bin"
- ls -lh "${PYTHON_INSTALL_EXE}"
- stat "${PYTHON_INSTALL_EXE}"
- /Applications/Python\ ${PYTHON_VERSION_SHORT}/Install\ Certificates.command || echo "No need to fix certificates"
- curl https://bootstrap.pypa.io/get-pip.py | ${PYTHON_INSTALL_EXE}
- >
"${PYTHON_INSTALL_EXE}" -m pip install -U pip
- >
"${PYTHON_INSTALL_EXE}" -m pip install -U virtualenv
- >
"${PYTHON_INSTALL_EXE}" -m virtualenv "${PYTHON_VENV_PATH}"
- . "${PYTHON_VENV_PATH}/bin/activate"
- curl https://bootstrap.pypa.io/get-pip.py | python
- python --version
- pip --version
before_cache:
- brew --cache
- &python_3_7_mixture
python: &mainstream_python 3.7
- &pure_python_base
<<: *stage_test
<<: *python_3_7_mixture
- &pure_python_base_priority
<<: *pure_python_base
<<: *stage_test_priority
- &lint_python_base
<<: *stage_lint
# Some linters depend on pyyaml, which fails under Python 3.7 now:
python: 3.6
after_failure: skip
- &docs_python_base
<<: *lint_python_base
addons:
apt:
packages:
- libenchant-dev
jobs:
fast_finish: true
allow_failures:
- env: TOXENV=pre-commit-failing
- python: nightly
include:
- python: *pypy2
env:
PYTEST_ADDOPTS: >-
'-p no:warnings'
- <<: *lint_python_base
name: pre-commit.com tool linters
env: TOXENV=pre-commit
- <<: *lint_python_base
<<: *python_3_7_mixture
name: setup.py check linter
env: TOXENV=setup-check
- <<: *lint_python_base
name: temporary failing pre-commit.com tool linters
env: TOXENV=pre-commit-failing
- <<: *docs_python_base
python: 3.8
name: Ensure that docs get built successfully
env: TOXENV=build-docs
- <<: *docs_python_base
python: 3.8
name: Spellcheck docs
env: TOXENV=spellcheck-docs
- <<: *docs_python_base
python: 3.8
name: Check links in docs
env: TOXENV=linkcheck-docs
- <<: *pure_python_base_priority
python: 3.8
- <<: *pure_python_base_priority
# mainstream here (3.7)
- <<: *pure_python_base_priority
python: nightly
- <<: *osx_python_base
<<: *manual_run_or_cron
python: 2.7
env:
PYTHON_VERSION: 2.7
- <<: *osx_python_base
<<: *manual_run_or_cron
python: 3.5
env:
PYTHON_VERSION: 3.5
- <<: *osx_python_base
python: 3.6
env:
PYTHON_VERSION: 3.6
- <<: *osx_python_base
python: *mainstream_python
env:
PYTHON_VERSION: *mainstream_python
- <<: *osx_python_base
<<: *manual_run_or_cron
before_install: *install-from-pyenv
python: nightly
env:
- PYTHON_VERSION=3.8-dev
- *env_pyenv
- *env_path
- <<: *osx_python_base
<<: *manual_run_or_cron
osx_image: xcode9.4
before_install: *install-from-pyenv
python: pypy3.6-7.1.0
env:
- PYTHON_VERSION=pypy3.6-7.1.0
- *env_pyenv
- *env_path
# pypy2.7-5.10.0 fails under OS X because it's unsupported
- <<: *stage_deploy
if: tag IS present
<<: *python_3_7_mixture
install:
- python -m pip install --upgrade virtualenv
- python -m pip install tox
env:
TOXENV: release
cache:
pip: true
directories:
- $HOME/.cache/pre-commit
- $HOME/.pre-commit
- $HOME/virtualenv/python$(python -c 'import platform; print(platform.python_version())')
- $HOME/Library/Caches/Homebrew
install:
- python -m pip install --upgrade virtualenv
- python -m pip install tox
- python -m tox --notest # Pre-populate a virtualenv with dependencies
- *python_ssl_openssl_version
- >-
".tox/${TOXENV:-python}/bin/python" -m OpenSSL.debug || true
script:
- python -m tox
after_failure:
- ip a
- sysctl -a
- echo "Here's a list of installed Python packages:"
- pip list --format=columns
- echo Dumping logs, because tests failed to succeed
- |
for log in `ls cheroot/test/*.log`
do
echo Outputting $log
cat $log
done
- py_log=/home/travis/build/cherrypy/cheroot/.tox/python/log/python-0.log
- echo Outputting python invocation log from $py_log
- cat $py_log
stages:
- *stage_lint_name
- *stage_test_priority_name
- *stage_test_name
- name: *stage_test_osx_name
if: type IN (api, cron) OR tag IS present
- name: *stage_deploy_name