|
1 | 1 | # https://travis-ci.org/tornadoweb/tornado
|
2 |
| -dist: trusty |
3 | 2 |
|
4 |
| -# Use containers instead of full VMs for faster startup. |
5 |
| -sudo: false |
| 3 | +os: linux |
| 4 | +dist: xenial |
| 5 | +language: python |
| 6 | +addons: |
| 7 | + apt: |
| 8 | + packages: |
| 9 | + - libgnutls-dev |
6 | 10 |
|
7 |
| -matrix: |
8 |
| - fast_finish: true |
| 11 | +env: |
| 12 | + global: |
| 13 | + - CIBW_BUILD="cp3[6789]*" |
| 14 | + - CIBW_TEST_COMMAND="python3 -m tornado.test" |
| 15 | + - CIBW_TEST_COMMAND_WINDOWS="python -m tornado.test --fail-if-logs=false" |
9 | 16 |
|
10 |
| -language: python |
11 |
| -# For a list of available versions, run |
12 |
| -# aws s3 ls s3://travis-python-archives/binaries/ubuntu/14.04/x86_64/ |
13 |
| -python: |
14 |
| - - 2.7 |
15 |
| - - pypy2.7-5.8.0 |
16 |
| - - 3.4 |
17 |
| - - 3.5 |
18 |
| - - 3.6 |
19 |
| - - nightly |
20 |
| - - pypy3.5-5.8.0 |
| 17 | +# Before starting the full build matrix, run one test configuration |
| 18 | +# and the linter (the `black` linter is especially likely to catch |
| 19 | +# first-time contributors). |
| 20 | +stages: |
| 21 | + - quick |
| 22 | + - test |
| 23 | + |
| 24 | +jobs: |
| 25 | + fast_finish: true |
| 26 | + include: |
| 27 | + # We have two and a half types of builds: Wheel builds run on all supported |
| 28 | + # platforms and run the basic test suite for all supported python versions. |
| 29 | + # Sdist builds (the "and a half") just build an sdist and run some basic |
| 30 | + # validation. Both of these upload their artifacts to pypi if there is a |
| 31 | + # tag on the build and the key is available. |
| 32 | + # |
| 33 | + # Tox builds run a more comprehensive test suite with more configurations |
| 34 | + # and dependencies (getting all these dependencies installed for wheel |
| 35 | + # builds is a pain, and slows things down because we don't use as much |
| 36 | + # parallelism there. We could parallelize wheel builds more but we're also |
| 37 | + # amortizing download costs across the different builds). The wheel builds |
| 38 | + # take longer, so we run them before the tox builds for better bin packing |
| 39 | + # in our allotted concurrency. |
| 40 | + - python: '3.8' |
| 41 | + arch: amd64 |
| 42 | + services: docker |
| 43 | + env: BUILD_WHEEL=1 |
| 44 | + - python: '3.8' |
| 45 | + arch: arm64 |
| 46 | + services: docker |
| 47 | + env: BUILD_WHEEL=1 ASYNC_TEST_TIMEOUT=15 |
| 48 | + - os: windows |
| 49 | + env: PATH=/c/Python38:/c/Python38/Scripts:$PATH BUILD_WHEEL=1 |
| 50 | + language: shell |
| 51 | + before_install: |
| 52 | + - choco install python --version 3.8.0 |
| 53 | + # Windows build images have outdated root certificates; until that's |
| 54 | + # fixed use certifi instead. |
| 55 | + # https://github.com/joerick/cibuildwheel/issues/452 |
| 56 | + - python -m pip install certifi |
| 57 | + - export SSL_CERT_FILE=`python -c "import certifi; print(certifi.where())"` |
| 58 | + - os: osx |
| 59 | + env: BUILD_WHEEL=1 |
| 60 | + language: shell |
| 61 | + |
| 62 | + - python: '3.8' |
| 63 | + arch: amd64 |
| 64 | + env: BUILD_SDIST=1 |
| 65 | + |
| 66 | + - python: '3.6' |
| 67 | + env: TOX_ENV=py36-full |
| 68 | + - python: '3.7' |
| 69 | + env: TOX_ENV=py37-full |
| 70 | + - python: '3.8' |
| 71 | + env: TOX_ENV=py38-full |
| 72 | + - python: '3.9-dev' |
| 73 | + env: TOX_ENV=py39-full |
| 74 | + - python: nightly |
| 75 | + env: TOX_ENV=py3 |
| 76 | + - python: pypy3.6-7.3.1 |
| 77 | + # Pypy is a lot slower due to jit warmup costs, so don't run the "full" |
| 78 | + # test config there. |
| 79 | + env: TOX_ENV=pypy3 |
| 80 | + # Docs and lint python versions must be synced with those in tox.ini |
| 81 | + - python: '3.8' |
| 82 | + env: TOX_ENV=docs |
| 83 | + |
| 84 | + # the quick stage runs first, but putting this at the end lets us take |
| 85 | + # advantage of travis-ci's defaults and not repeat stage:test in the others. |
| 86 | + - python: '3.8' |
| 87 | + env: TOX_ENV=py38,lint |
| 88 | + stage: quick |
21 | 89 |
|
22 | 90 | install:
|
23 |
| - # On nightly, upgrade setuptools first to work around |
24 |
| - # https://github.com/pypa/setuptools/issues/1257 |
25 |
| - - if [[ $TRAVIS_PYTHON_VERSION == 'nightly' ]]; then travis_retry pip install -U setuptools; fi |
26 |
| - - if [[ $TRAVIS_PYTHON_VERSION == 2* ]]; then travis_retry pip install mock monotonic; fi |
27 |
| - - if [[ $TRAVIS_PYTHON_VERSION == 'pypy' ]]; then travis_retry pip install mock; fi |
28 |
| - # TODO(bdarnell): pycares tests are currently disabled on travis due to ipv6 issues. |
29 |
| - #- if [[ $TRAVIS_PYTHON_VERSION != 'pypy'* ]]; then travis_retry pip install pycares; fi |
30 |
| - - if [[ $TRAVIS_PYTHON_VERSION != 'pypy'* ]]; then travis_retry pip install pycurl; fi |
31 |
| - # Twisted runs on 2.x and 3.3+, but is flaky on pypy. |
32 |
| - - if [[ $TRAVIS_PYTHON_VERSION != 'pypy'* ]]; then travis_retry pip install Twisted; fi |
33 |
| - - if [[ $TRAVIS_PYTHON_VERSION == '2.7' || $TRAVIS_PYTHON_VERSION == '3.6' ]]; then travis_retry pip install sphinx sphinx_rtd_theme; fi |
34 |
| - - if [[ $TRAVIS_PYTHON_VERSION == '3.6' ]]; then travis_retry pip install flake8; fi |
35 |
| - # On travis the extension should always be built |
36 |
| - - if [[ $TRAVIS_PYTHON_VERSION != 'pypy'* ]]; then export TORNADO_EXTENSION=1; fi |
37 |
| - - travis_retry python setup.py install |
38 |
| - - travis_retry pip install codecov virtualenv |
39 |
| - # Create a separate no-dependencies virtualenv to make sure all imports |
40 |
| - # of optional-dependencies are guarded. |
41 |
| - - virtualenv ./nodeps |
42 |
| - - ./nodeps/bin/python -VV |
43 |
| - - ./nodeps/bin/python setup.py install |
44 |
| - - curl-config --version; pip freeze |
| 91 | + - if [[ -n "$TOX_ENV" ]]; then pip3 install tox; fi |
| 92 | + - if [[ -n "$BUILD_WHEEL" ]]; then pip3 install cibuildwheel; fi |
| 93 | + - if [[ -n "$BUILD_WHEEL" || -n "$BUILD_SDIST" ]]; then pip3 install twine; fi |
45 | 94 |
|
46 | 95 | script:
|
47 |
| - # Run the tests once from the source directory to detect issues |
48 |
| - # involving relative __file__ paths; see |
49 |
| - # https://github.com/tornadoweb/tornado/issues/1780 |
50 |
| - - unset TORNADO_EXTENSION && python -m tornado.test |
51 |
| - # For all other test variants, get out of the source directory before |
52 |
| - # running tests to ensure that we get the installed speedups module |
53 |
| - # instead of the source directory which doesn't have it. |
54 |
| - - cd maint |
55 |
| - # Copy the coveragerc down so coverage.py can find it. |
56 |
| - - cp ../.coveragerc . |
57 |
| - - if [[ $TRAVIS_PYTHON_VERSION != 'pypy'* ]]; then export TORNADO_EXTENSION=1; fi |
58 |
| - - export TARGET="-m tornado.test.runtests" |
59 |
| - # Travis workers are often overloaded and cause our tests to exceed |
60 |
| - # the default timeout of 5s. |
61 |
| - - export ASYNC_TEST_TIMEOUT=15 |
62 |
| - # We use "python -m coverage" instead of the "bin/coverage" script |
63 |
| - # so we can pass additional arguments to python. |
64 |
| - # coverage needs a function that was removed in python 3.6 so we can't |
65 |
| - # run it with nightly cpython. Coverage is very slow on pypy. |
66 |
| - - if [[ $TRAVIS_PYTHON_VERSION != nightly && $TRAVIS_PYTHON_VERSION != 'pypy'* ]]; then export RUN_COVERAGE=1; fi |
67 |
| - - if [[ "$RUN_COVERAGE" == 1 ]]; then export TARGET="-m coverage run $TARGET"; fi |
68 |
| - - python $TARGET |
69 |
| - - if [[ $TRAVIS_PYTHON_VERSION == 2* ]]; then python $TARGET --ioloop=tornado.platform.select.SelectIOLoop; fi |
70 |
| - - python -O $TARGET |
71 |
| - - LANG=C python $TARGET |
72 |
| - - LANG=en_US.utf-8 python $TARGET |
73 |
| - - if [[ $TRAVIS_PYTHON_VERSION == 3* ]]; then python -bb $TARGET; fi |
74 |
| - - if [[ $TRAVIS_PYTHON_VERSION == 2* ]]; then python $TARGET --httpclient=tornado.curl_httpclient.CurlAsyncHTTPClient; fi |
75 |
| - - if [[ $TRAVIS_PYTHON_VERSION == 2* ]]; then python $TARGET --ioloop=tornado.platform.twisted.TwistedIOLoop; fi |
76 |
| - - if [[ $TRAVIS_PYTHON_VERSION == 2* ]]; then python $TARGET --resolver=tornado.platform.twisted.TwistedResolver; fi |
77 |
| - - if [[ $TRAVIS_PYTHON_VERSION == 2* ]]; then python $TARGET --ioloop=tornado.ioloop.PollIOLoop --ioloop_time_monotonic; fi |
78 |
| - #- if [[ $TRAVIS_PYTHON_VERSION != pypy* ]]; then python $TARGET --resolver=tornado.platform.caresresolver.CaresResolver; fi |
79 |
| - - if [[ $TRAVIS_PYTHON_VERSION != 'pypy3' ]]; then ../nodeps/bin/python -m tornado.test.runtests; fi |
80 |
| - # make coverage reports for Codecov to find |
81 |
| - - if [[ "$RUN_COVERAGE" == 1 ]]; then coverage xml; fi |
82 |
| - - export TORNADO_EXTENSION=0 |
83 |
| - - if [[ $TRAVIS_PYTHON_VERSION == 3.6 ]]; then cd ../docs && mkdir sphinx-out && sphinx-build -E -n -W -b html . sphinx-out; fi |
84 |
| - - if [[ $TRAVIS_PYTHON_VERSION == '2.7' || $TRAVIS_PYTHON_VERSION == 3.6 ]]; then cd ../docs && mkdir sphinx-doctest-out && sphinx-build -E -n -b doctest . sphinx-out; fi |
85 |
| - - if [[ $TRAVIS_PYTHON_VERSION == '3.6' ]]; then flake8; fi |
| 96 | + - if [[ -n "$TOX_ENV" ]]; then tox -e $TOX_ENV -- $TOX_ARGS; fi |
| 97 | + - if [[ -n "$BUILD_WHEEL" ]]; then cibuildwheel --output-dir dist && ls -l dist; fi |
| 98 | + - if [[ -n "$BUILD_SDIST" ]]; then python setup.py check sdist && ls -l dist; fi |
86 | 99 |
|
87 | 100 | after_success:
|
88 |
| - # call codecov from project root |
89 |
| - - if [[ "$RUN_COVERAGE" == 1 ]]; then cd ../ && codecov; fi |
| 101 | + - if [[ ( -n "$BUILD_WHEEL" || -n "$BUILD_SDIST" ) && -n "$TRAVIS_TAG" && -n "$TWINE_PASSWORD" ]]; then twine upload -u __token__ dist/*; fi |
0 commit comments