diff --git a/.travis.yml b/.travis.yml index 2cb634294057..c181c7c7a105 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,21 +1,46 @@ -sudo: false +if: tag IS present OR type = pull_request OR (branch = master AND type = push) # we only CI the master, tags and PRs + language: python # cache package wheels (1 cache per python version) cache: pip -python: - - "3.4" +# newer python versions are available only on xenial (while some older only on trusty) Ubuntu distribution +dist: xenial +sudo: required + +env: + TOXENV=py + EXTRA_ARGS="-n 12" + +jobs: + include: + - name: "run test suite with python 3.4" + python: 3.4 + dist: trusty # Specifically request 3.5.1 because we need to be compatible with that. - - "3.5.1" - - "3.6" - - "3.7-dev" + - name: "run test suite with python 3.5.1" + python: 3.5.1 + dist: trusty + - name: "run test suite with python 3.6" + python: 3.6 # 3.6.3 pip 9.0.1 + - name: "run test suite with python 3.7" + python: 3.7 # 3.7.0 pip 10.0.1 + - name: "run test suite with python 3.8-dev" + python: 3.8-dev + - name: "type check our own code" + python: 3.7 + env: + - TOXENV=type + - EXTRA_ARGS= + - name: "check code style with flake8" + python: 3.7 + env: + - TOXENV=lint + - EXTRA_ARGS= install: - - pip install -U pip setuptools wheel - - pip install -r test-requirements.txt - - python2 -m pip install --user typing - - pip install . +- pip install -U pip setuptools +- pip install -U tox +- tox --notest script: - - pytest -n12 - - if [[ $TRAVIS_PYTHON_VERSION == '3.6' ]]; then flake8 -j12; fi - - if [[ $TRAVIS_PYTHON_VERSION == '3.5.1' ]]; then python3 -m mypy --config-file mypy_self_check.ini -p mypy; fi +- tox -- $EXTRA_ARGS diff --git a/appveyor.yml b/appveyor.yml index d577ca6ad2fa..e714e415aed1 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -4,24 +4,22 @@ cache: environment: matrix: - - PYTHON: "C:\\Python36-x64" - PYTHON_VERSION: "3.6.x" + - PYTHON: "C:\\Python37-x64" + PYTHON_VERSION: "3.7.x" PYTHON_ARCH: "64" install: - "git config core.symlinks true" - "git reset --hard" - - "%PYTHON%\\python.exe -m pip install -r test-requirements.txt" - - "C:\\Python27\\python.exe -m pip install typing" - "git submodule update --init typeshed" - "cd typeshed && git config core.symlinks true && git reset --hard && cd .." - - "%PYTHON%\\python.exe -m pip install ." + - "%PYTHON%\\python.exe -m pip install -U setuptools tox" + - "%PYTHON%\\python.exe -m tox -e py37 --notest" build: off test_script: - # lint and mypy self check run in Travis - - "%PYTHON%\\python.exe -m pytest -k \"not (PythonEvaluationSuite and python2)\"" + - "%PYTHON%\\python.exe -m tox -e py37" skip_commits: files: diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 000000000000..251adad05d7b --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,5 @@ +[build-system] +requires = [ + "setuptools >= 30.0.2", + "wheel >= 0.29.0" +] diff --git a/test-requirements.txt b/test-requirements.txt index 7448ef29c50b..32554d00007f 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -2,7 +2,7 @@ attrs>=18.0 flake8 flake8-bugbear; python_version >= '3.5' flake8-pyi; python_version >= '3.6' -lxml==4.2.3 +lxml==4.2.4 psutil==5.4.0 pytest>=3.4 pytest-xdist>=1.22 diff --git a/tox.ini b/tox.ini index dac7e9abd90d..0c6717780cd7 100644 --- a/tox.ini +++ b/tox.ini @@ -11,29 +11,30 @@ envlist = py34, [testenv] description = run the test driver with {basepython} +passenv = PYTEST_XDIST_WORKER_COUNT deps = -rtest-requirements.txt commands = pytest {posargs} [testenv:lint] description = check the code style -basepython = python3.6 +basepython = python3.7 commands = flake8 -j0 {posargs} [testenv:type] description = type check ourselves -basepython = python3.6 +basepython = python3.7 commands = python3 -m mypy --config-file mypy_self_check.ini -p mypy [testenv:docs] description = invoke sphinx-build to build the HTML docs -basepython = python3.6 +basepython = python3.7 deps = -rdocs/requirements-docs.txt commands = sphinx-build -d "{toxworkdir}/docs_doctree" docs/source "{toxworkdir}/docs_out" --color -W -bhtml {posargs} [testenv:dev] description = generate a DEV environment, that has all project libraries usedevelop = True -basepython = python3.6 +basepython = python3.7 deps = -rtest-requirements.txt -rdocs/requirements-docs.txt commands = python -m pip list --format=columns