diff --git a/.travis.yml b/.travis.yml index 58a71c48768..e3b020e5687 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,49 +3,62 @@ sudo: false cache: pip dist: trusty -matrix: - fast_finish: true +stages: +- primary +- secondary + +jobs: include: - - env: TOXENV=docs + # Basic Checks + - stage: primary + env: TOXENV=docs - env: TOXENV=lint-py2 - env: TOXENV=lint-py3 + python: 3.6 - env: TOXENV=mypy - env: TOXENV=packaging - # PyPy jobs start first -- they are the slowest - - env: TOXENV=pypy3-functional-install - python: pypy3 - - env: TOXENV=pypy3-others - python: pypy3 - - env: TOXENV=pypy-functional-install - python: pypy - - env: TOXENV=pypy-others - python: pypy - # Latest Stable CPython jobs - - env: TOXENV=py27-functional-install + # Latest CPython + - env: GROUP=1 python: 2.7 - - env: TOXENV=py27-others + - env: GROUP=2 python: 2.7 - - env: TOXENV=py36-functional-install + - env: GROUP=1 python: 3.6 - - env: TOXENV=py36-others + - env: GROUP=2 python: 3.6 - # All the other Py3 versions - - env: TOXENV=py35-functional-install + + # Complete checking for ensuring compatibility + # PyPy + - stage: secondary + env: GROUP=1 + python: pypy3 + - env: GROUP=2 + python: pypy3 + - env: GROUP=1 + python: pypy + - env: GROUP=2 + python: pypy + # Older Supported CPython + - env: GROUP=1 python: 3.5 - - env: TOXENV=py35-others + - env: GROUP=2 python: 3.5 - - env: TOXENV=py34-functional-install + - env: GROUP=1 python: 3.4 - - env: TOXENV=py34-others + - env: GROUP=2 python: 3.4 - # Nightly Python goes last - - env: TOXENV=py37-functional-install - python: nightly - - env: TOXENV=py37-others - python: nightly + + - env: GROUP=1 + python: 3.7-dev + - env: GROUP=2 + python: 3.7-dev + + # It's okay to fail on the in-development CPython version. + fast_finish: true allow_failures: - - python: nightly + - python: 3.7-dev +before_install: .travis/setup.sh install: travis_retry .travis/install.sh script: .travis/run.sh diff --git a/.travis/install.sh b/.travis/install.sh index 8b700ba3227..ad67bb65a8e 100755 --- a/.travis/install.sh +++ b/.travis/install.sh @@ -2,8 +2,5 @@ set -e set -x -git config --global user.email "pypa-dev@googlegroups.com" -git config --global user.name "pip" - pip install --upgrade setuptools pip install --upgrade tox diff --git a/.travis/run.sh b/.travis/run.sh index f99468b1c49..df06b8b3391 100755 --- a/.travis/run.sh +++ b/.travis/run.sh @@ -1,6 +1,5 @@ #!/bin/bash set -e -set -x # Short circuit tests and linting jobs if there are no code changes involved. if [[ $TOXENV != docs ]]; then @@ -24,16 +23,31 @@ if [[ $TOXENV != docs ]]; then fi fi -if [[ $TOXENV == py*-functional-install ]]; then - # Only run test_install*.py integration tests - tox -- -m integration -n 4 --duration=5 -k test_install -elif [[ $TOXENV == py* ]]; then - # Run unit tests - tox -- -m unit +# Export the correct TOXENV when not provided. +echo "Determining correct TOXENV..." +if [[ -z "$TOXENV" ]]; then + if [[ ${TRAVIS_PYTHON_VERSION} == pypy* ]]; then + export TOXENV=${TRAVIS_PYTHON_VERSION} + else + # We use the syntax ${string:index:length} to make 2.7 -> py27 + _major=${TRAVIS_PYTHON_VERSION:0:1} + _minor=${TRAVIS_PYTHON_VERSION:2:1} + export TOXENV="py${_major}${_minor}" + fi +fi +echo "TOXENV=${TOXENV}" - # Run other integration tests +# Print the commands run for this test. +set -x +if [[ "$GROUP" == "1" ]]; then + # Unit tests + tox -- -m unit + # Integration tests (not the ones for 'pip install') tox -- -m integration -n 4 --duration=5 -k "not test_install" +elif [[ "$GROUP" == "2" ]]; then + # Separate Job for running integration tests for 'pip install' + tox -- -m integration -n 4 --duration=5 -k "test_install" else - # Run once + # Non-Testing Jobs should run once tox fi diff --git a/.travis/setup.sh b/.travis/setup.sh new file mode 100755 index 00000000000..d4676e2fbc4 --- /dev/null +++ b/.travis/setup.sh @@ -0,0 +1,6 @@ +#!/bin/bash +set -e + +echo "Setting Git Credentials..." +git config --global user.email "pypa-dev@googlegroups.com" +git config --global user.name "pip" diff --git a/tox.ini b/tox.ini index 789fad8d85a..1a4513fba00 100644 --- a/tox.ini +++ b/tox.ini @@ -1,7 +1,7 @@ [tox] envlist = docs, packaging, lint-py2, lint-py3, mypy, - py{27,34,35,36,37,py,py3}-{functional-install,others} + py27, py34, py35, py67, py37, pypy, pypy3 [testenv] passenv = CI GIT_SSL_CAINFO