From b710585d3eb1153b8350a4de1311bcbac5e630e4 Mon Sep 17 00:00:00 2001 From: Bernat Gabor Date: Thu, 2 Aug 2018 17:33:42 +0100 Subject: [PATCH 1/4] CI upgrades - Travis test with python3.7 and python3.8-dev - Travis use tox to setup/run tests - Bump tox default envs from python3.6 to python3.7 --- .travis.yml | 42 +++++++++++++++++++++++++++++------------- tox.ini | 9 +++++---- 2 files changed, 34 insertions(+), 17 deletions(-) diff --git a/.travis.yml b/.travis.yml index 2cb634294057..ed99c48a68de 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,21 +1,37 @@ -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" +dist: xenial +sudo: required + +env: + TOXENV=py + EXTRA_ARGS=-n 12 + +jobs: + include: + - 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" + - python: 3.5.1 + dist: trusty + - python: 3.6 # 3.6.3 pip 9.0.1 + - python: 3.7 # 3.7.0 pip 10.0.1 + - python: 3.8-dev + - python: 3.7 + env: + - TOXENV=type + - EXTRA_ARGS= + - 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 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/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 From c658216c0a17e6c9a5f3f2bddf214b6fa0667e21 Mon Sep 17 00:00:00 2001 From: Bernat Gabor Date: Thu, 2 Aug 2018 17:58:28 +0100 Subject: [PATCH 2/4] specify build dependency and ensure latest pip in Travis --- .travis.yml | 3 ++- pyproject.toml | 5 +++++ 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 pyproject.toml diff --git a/.travis.yml b/.travis.yml index ed99c48a68de..8d55c75df008 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,7 +8,7 @@ sudo: required env: TOXENV=py - EXTRA_ARGS=-n 12 + EXTRA_ARGS="-n 12" jobs: include: @@ -30,6 +30,7 @@ jobs: - EXTRA_ARGS= install: +- pip install -U pip setuptools - pip install -U tox - tox --notest 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" +] From 4686ad5559cc1694e247a012ce243ed4cb9a88d9 Mon Sep 17 00:00:00 2001 From: Bernat Gabor Date: Fri, 3 Aug 2018 20:56:23 +0100 Subject: [PATCH 3/4] name jobs and comment on distrubution usage for them --- .travis.yml | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/.travis.yml b/.travis.yml index 8d55c75df008..c181c7c7a105 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,6 +3,7 @@ if: tag IS present OR type = pull_request OR (branch = master AND type = push) language: python # cache package wheels (1 cache per python version) cache: pip +# newer python versions are available only on xenial (while some older only on trusty) Ubuntu distribution dist: xenial sudo: required @@ -12,19 +13,26 @@ env: jobs: include: - - python: 3.4 + - 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. - - python: 3.5.1 + - name: "run test suite with python 3.5.1" + python: 3.5.1 dist: trusty - - python: 3.6 # 3.6.3 pip 9.0.1 - - python: 3.7 # 3.7.0 pip 10.0.1 - - python: 3.8-dev - - python: 3.7 + - 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= - - python: 3.7 + - name: "check code style with flake8" + python: 3.7 env: - TOXENV=lint - EXTRA_ARGS= From 205fb6f9ccc41a16540ea85fa46e8e93545850fe Mon Sep 17 00:00:00 2001 From: Bernat Gabor Date: Fri, 3 Aug 2018 22:55:49 +0100 Subject: [PATCH 4/4] AppVeyor run with tox and Python 3.7.x --- appveyor.yml | 12 +++++------- test-requirements.txt | 2 +- 2 files changed, 6 insertions(+), 8 deletions(-) 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/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