@@ -11,10 +11,13 @@ dist: xenial
11
11
group :travis_latest
12
12
os :linux
13
13
14
+
14
15
env :
15
16
global :
16
17
-BUILD_RUNTIMES=$HOME/.runtimes
17
18
-PYTHONHASHSEED=8675309
19
+ -PYTHONUNBUFFERED=1
20
+ -PYTHONDONTWRITEBYTECODE=1
18
21
-PIP_UPGRADE_STRATEGY=eager
19
22
-CC="ccache gcc"
20
23
-CCACHE_NOCPP2=true
28
31
-CPPFLAGS="-I$BUILD_LIBS/include -DEV_VERIFY=3"
29
32
-LDFLAGS="-L$BUILD_LIBS/lib"
30
33
-LD_LIBRARY_PATH="$BUILD_LIBS/lib"
34
+ # Uploading built wheels for releases.
35
+ # TWINE_PASSWORD is encrypted and stored directly in the
36
+ # travis repo settings.
37
+ -TWINE_USERNAME="__token__"
31
38
32
39
# Note that this list is again *manually* expanded
33
- # for the 'cache ' stage. The benefit of doing this (instead of
40
+ # for the 'build-gevent ' stage. The benefit of doing this (instead of
34
41
# only listing a single version here, or using a different 'language')
35
42
# is that we get separate caches per version. This keeps them small,
36
43
# and prevents stepping on each other when we change Python minor
51
58
-TRAVIS_PYTHON_VERSION=pypy3.6
52
59
-TRAVIS_PYTHON_VERSION=2.7 GEVENTSETUP_EMBED=0 GEVENTSETUP_EV_VERIFY=3
53
60
54
-
55
- before_install :
56
- -export PATH=$BUILD_RUNTIMES/snakepit/$TRAVIS_PYTHON_VERSION.d/bin:$PATH
57
- -export G_SITE=$BUILD_RUNTIMES/snakepit/$TRAVIS_PYTHON_VERSION.d/lib/*/site-packages/
58
- # Restore the configure caches
59
- -if [ -f $BUILD_LIBS/config.cache.ares ]; then cp $BUILD_LIBS/config.cache.ares deps/c-ares/config.cache ; fi
60
- -if [ -f $BUILD_LIBS/config.cache.libev ]; then cp $BUILD_LIBS/config.cache.libev deps/libev/config.cache ; fi
61
- -if [ -f $BUILD_LIBS/config.cache.libuv ]; then cp $BUILD_LIBS/config.cache.libuv deps/libuv/config.cache ; fi
62
-
63
- before_script :
64
- # Show some details of interest
65
- -python --version
66
- ->
67
- python -c "import greenlet; print(greenlet, greenlet.__version__)"
68
- ->
69
- python -c "import gevent.core; print(gevent.core.loop)"
70
- ->
71
- python -c "import gevent.ares; print(gevent.ares)"
72
-
73
61
cache :
74
62
pip :true
75
63
directories :
76
64
-$HOME/.venv
77
65
-$HOME/.runtimes
78
66
-$HOME/.wheelhouse
79
67
-$HOME/.ccache
80
- -$HOME/.libs
68
+ -$BUILD_LIBS
69
+ -$HOME/Library/Caches/pip
81
70
82
71
before_cache :
83
72
-rm -f $HOME/.cache/pip/log/debug.log
84
73
# Store the configure caches. Having a cache can speed up c-ares
85
74
# configure from 2-3 minutes to 20 seconds.
86
75
-mkdir -p $BUILD_LIBS
87
- -cp deps/c-ares/config.cache $BUILD_LIBS/config.cache.ares
88
- -cp deps/libev/config.cache $BUILD_LIBS/config.cache.libev
89
- -cp deps/libuv/config.cache $BUILD_LIBS/config.cache.libuv
76
+ -if [ -f deps/c-ares/config.cache ]; then cp deps/c-ares/config.cache $BUILD_LIBS/config.cache.ares ; fi
77
+ -if [ -f deps/libev/config.cache ]; then cp deps/libev/config.cache $BUILD_LIBS/config.cache.libev ; fi
78
+ -if [ -f deps/libuv/config.cache ]; then cp deps/libuv/config.cache $BUILD_LIBS/config.cache.libuv ; fi
79
+
80
+ before_install :
81
+ -export PATH=$BUILD_RUNTIMES/snakepit/$TRAVIS_PYTHON_VERSION.d/bin:$PATH
82
+ -export G_SITE=$BUILD_RUNTIMES/snakepit/$TRAVIS_PYTHON_VERSION.d/lib/*/site-packages/
83
+ # Restore the configure caches
84
+ -if [ -f $BUILD_LIBS/config.cache.ares ]; then cp $BUILD_LIBS/config.cache.ares deps/c-ares/config.cache ; fi
85
+ -if [ -f $BUILD_LIBS/config.cache.libev ]; then cp $BUILD_LIBS/config.cache.libev deps/libev/config.cache ; fi
86
+ -if [ -f $BUILD_LIBS/config.cache.libuv ]; then cp $BUILD_LIBS/config.cache.libuv deps/libuv/config.cache ; fi
87
+ -|
88
+ if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
89
+ whoami
90
+ mkdir -p $HOME/Library/Caches/pip
91
+ chown -R `whoami` $HOME/Library/Caches/pip
92
+ git clone https://github.com/MacPython/terryfy
93
+ source terryfy/travis_tools.sh
94
+ get_python_environment $TERRYFY_PYTHON venv
95
+ unset CC
96
+ fi
97
+
98
+ before_script :
99
+ # Show some details of interest
100
+ -|
101
+ python --version
102
+ python -c 'import greenlet; print(greenlet, greenlet.__version__)'
103
+ python -c 'import gevent.core; print(gevent.core.loop)'
104
+ python -c 'import gevent.ares; print(gevent.ares)'
90
105
91
106
92
107
# Installing is taken care of by the first stage.
@@ -112,15 +127,30 @@ script:
112
127
113
128
# Submit coverage info
114
129
after_success :
115
- -python -m coverage combine
116
- -python -m coverage report -i
117
- -python -m coveralls
130
+ -python -m coverage combine || true
131
+ -python -m coverage report -i || true
132
+ -python -m coveralls || true
133
+ -|
134
+ if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
135
+ ls -l dist
136
+ twine check dist/*
137
+ if [[ $TRAVIS_TAG ]]; then
138
+ twine upload --skip-existing dist/*
139
+ fi
140
+ fi
141
+ -|
142
+ if [[ -n "$DOCKER_IMAGE" ]]; then
143
+ ls -l wheelhouse
144
+ twine check wheelhouse/*
145
+ if [[ $TRAVIS_TAG ]]; then
146
+ twine upload --skip-existing wheelhouse/*
147
+ fi
148
+ fi
118
149
119
150
120
151
stages :
121
152
-build-gevent
122
153
-test
123
- -test-ares
124
154
125
155
126
156
jobs :
@@ -139,7 +169,7 @@ jobs:
139
169
# First, the build dependencies (see setup.cfg)
140
170
# so that we don't have to use build isolation and can better use the cache;
141
171
# Note that we can't use -U for cffi and greenlet on PyPy.
142
- - &build-gevent-deps pip install -U setuptools wheel && pip install -U 'cffi;platform_python_implementation=="CPython"' cython 'greenlet;platform_python_implementation=="CPython"'
172
+ - &build-gevent-deps pip install -U setuptools wheeltwine && pip install -U 'cffi;platform_python_implementation=="CPython"' cython 'greenlet;platform_python_implementation=="CPython"'
143
173
# Next, build the wheel *in place*. This helps ccache, and also lets us cache the configure
144
174
# output (pip install uses a random temporary directory, making this difficult)
145
175
-python setup.py bdist_wheel
@@ -194,7 +224,26 @@ jobs:
194
224
-python -c 'import gevent.libuv.loop as CF; assert not CF.libuv.LIBUV_EMBED'
195
225
196
226
# Ok, now we switch to the test stage. These are all in addition
197
- # to the jobs created by the matrix (and should override the `script` command).
227
+ # to the jobs created by the matrix (and should override the
228
+ # `script` command).
229
+
230
+ # The manylinux builds and tests.
231
+ # These take awhile, so get them started while others proceed in parallel.
232
+ -stage :test
233
+ name :64-bit manylinux wheels (all Pythons)
234
+ services :docker
235
+ env :DOCKER_IMAGE=quay.io/pypa/manylinux2010_x86_64
236
+ install :docker pull $DOCKER_IMAGE
237
+ script :bash scripts/releases/make-manylinux
238
+ before_script :true
239
+
240
+ -stage :test
241
+ name :32-bit manylinux wheels (all Pythons)
242
+ services :docker
243
+ env :DOCKER_IMAGE=quay.io/pypa/manylinux2010_i686 PRE_CMD=linux32
244
+ install :docker pull $DOCKER_IMAGE
245
+ script :bash scripts/releases/make-manylinux
246
+ before_script :true
198
247
199
248
# Lint the code. Because this is a separate job, even if it fails fast
200
249
# the tests will still run. Put it at the top for fast feedback.
@@ -314,6 +363,44 @@ jobs:
314
363
# env: TRAVIS_PYTHON_VERSION=pypy3.6
315
364
# name: dnspythonpypy36
316
365
366
+ # ##
367
+ # Python on macOS.
368
+ # These take awhile, and tend to gum up the works getting started.
369
+ # TODO: maybe these and manylinux builds should be their own stage?
370
+ # ##
371
+
372
+ # It's important to use 'macpython' builds to get the least
373
+ # restrictive wheel tag. It's also important to avoid
374
+ # 'homebrew 3' because it floats instead of being a specific
375
+ # version.
376
+ # TODO: This could probably be better broken into stages and just
377
+ # generally added to the matrix.
378
+ - &test-base-osx
379
+ name :Python 2.7 wheels for MacOS
380
+ os :osx
381
+ osx_image :xcode11.3
382
+ compiler :clang
383
+ # We require at least 2.7.15 to upload wheels.
384
+ # See https://github.com/zopefoundation/BTrees/issues/113
385
+ env :TERRYFY_PYTHON='macpython 2.7.17'
386
+ install :
387
+ -mkdir -p $BUILD_LIBS/lib
388
+ - *build-gevent-deps
389
+ -python setup.py bdist_wheel
390
+ -pip uninstall -y gevent
391
+ -pip install -U --no-compile `ls dist/gevent*whl`[test]
392
+
393
+ -<< :*test-base-osx
394
+ name :Python 3.6 wheels for MacOS
395
+ env :TERRYFY_PYTHON='macpython 3.6.8'
396
+
397
+ -<< :*test-base-osx
398
+ name :Python 3.7 wheels for MacOS
399
+ env :TERRYFY_PYTHON='macpython 3.7.6'
400
+
401
+ -<< :*test-base-osx
402
+ name :Python 3.8 wheels for MacOS
403
+ env :TERRYFY_PYTHON='macpython 3.8.1'
317
404
318
405
notifications :
319
406
email :false