From b24071ca134538c4011b21489fb12c145fb55442 Mon Sep 17 00:00:00 2001 From: Alexander Loechel Date: Wed, 3 Oct 2018 15:22:55 +0200 Subject: [PATCH] symetric test setup on all devices and appveyor --- .travis.yml | 48 +++++++++++++++++++++++------- appveyor.yml | 53 +++++++++++++++++++++++++++++++++ tox.ini | 82 +++++++++++++++++++++++++++++++++++++++++++++++++++- 3 files changed, 171 insertions(+), 12 deletions(-) create mode 100644 appveyor.yml diff --git a/.travis.yml b/.travis.yml index f2f19403f2..ddba477283 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,24 +1,50 @@ language: python sudo: false -python: - - 2.7 - - 3.5 - - 3.6 + +matrix: + include: + - python: "2.7" + env: TOXENV=docs,lint + - python: "3.6" + env: TOXENV=docs,lint + - python: "2.7" + env: TOXENV=py27 + - python: "3.5" + env: TOXENV=py35 + - python: "3.6" + env: TOXENV=py36 + - python: "3.7" + env: TOXENV=py37 + dist: xenial + sudo: true + - python: "3.7-dev" + env: TOXENV=py37 + dist: xenial + sudo: true + - python: "3.8-dev" + env: TOXENV=py38 + dist: xenial + sudo: true +allow_failures: + - python: "3.8-dev" + env: TOXENV=py38 + install: - - pip install -U setuptools==`grep setuptools versions.cfg | awk '{print $3}'` - - pip install six==`grep '^six' versions-prod.cfg | awk '{print $3}'` - - pip install zc.buildout==`grep '^zc.buildout' versions.cfg | awk '{print $3}'` - - pip install coveralls coverage - - buildout bootstrap - - buildout install test alltests + - travis_retry pip install -U pip setuptools + - travis_retry pip install -U tox coveralls coverage + script: - - coverage run bin/alltests -v + - travis_retry tox + after_success: + - coverage combine - coveralls # Bails out for non-tags - ./update_index.sh + notifications: email: false + cache: pip: true directories: diff --git a/appveyor.yml b/appveyor.yml new file mode 100644 index 0000000000..21d6b4a8ec --- /dev/null +++ b/appveyor.yml @@ -0,0 +1,53 @@ +# AppVeyor CI settings (Windows Machine CI Tests) + +matrix: + allow_failures: + - PROFILE: py38 + +environment: + matrix: + - PROFILE: py27-conventions + PYTHON_VERSION: 2.7" + TOXENV: "lint,docs" + - PROFILE: py35-conventions + PYTHON_VERSION: 3.6" + TOXENV: "lint,docs" + - PROFILE: py36-conventions + PYTHON_VERSION: 3.6" + TOXENV: "lint,docs" + - PROFILE: py37-conventions + PYTHON_VERSION: 3.7" + TOXENV: "lint,docs" + - PROFILE: py27 + PYTHON_VERSION: 2.7" + TOXENV: "py27" + - PROFILE: py35 + PYTHON_VERSION: 3.5" + TOXENV: "py35" + - PROFILE: py36 + PYTHON_VERSION: 3.6" + TOXENV: "py36" + - PROFILE: py37 + PYTHON_VERSION: 3.7" + TOXENV: "py37" + - PROFILE: py38 + PYTHON_VERSION: 3.8" + TOXENV: "py38" + +cache: + - '%LOCALAPPDATA%\pip\Cache' + +version: '{branch}.{build}' + +install: + - "python.exe -m pip install tox" + +build: off + +test_script: + - "tox.exe" + +after_success: + - coveralls + # Bails out for non-tags + - ./update_index.sh diff --git a/tox.ini b/tox.ini index 6aa2a9185a..ca1429c67c 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,12 @@ [tox] -envlist = py27,py35,py36,coverage-report +envlist = + py27, + py35, + py36, + py37, + lint-py27, + lint-py36 + coverage-report [testenv] commands = @@ -26,3 +33,76 @@ commands = coverage html -i coverage xml -i coverage report -i --fail-under=79 + +[testenv:isort-apply] +basepython = python2.7 +skip_install = true +deps = + -cconstraints.txt + isort + +commands = + isort --apply --recursive {toxinidir}/src {toxinidir}/tests {posargs} + +[testenv:autopep8] +basepython = python2.7 +skip_install = true +deps = + -cconstraints.txt + autopep8 + docformatter + +commands = + autopep8 --verbose --in-place --recursive --aggressive --aggressive {toxinidir}/src {toxinidir}/tests setup.py + docformatter --in-place --recursive {toxinidir}/src {toxinidir}/tests setup.py + +[lint] +skip_install = true + +deps = + -cconstraints.txt + isort + flake8 + # helper to generate HTML reports: + flake8-html + # Useful flake8 plugins that are Python and Plone specific: + flake8-coding + flake8-debugger + flake8-deprecated + flake8-pytest + flake8-todo + flake8-isort + mccabe + # Potential flake8 plugins that should be used: # TBD + #flake8-blind-except + #flake8-commas + #flake8-docstrings + #flake8-mypy + #flake8-pep3101 + #flake8-plone-hasattr + #flake8-string-format + #flake8_strict + #flake8-quotes + +commands = + mkdir -p {toxinidir}/_build/flake8 + isort --check-only --recursive {toxinidir}/src {toxinidir}/tests setup.py + - flake8 --format=html --htmldir={toxinidir}/_build/flake8 --doctests src tests setup.py + flake8 src tests setup.py --doctests + +whitelist_externals = + mkdir + +[testenv:lint-py27] +basepython = python2.7 +skip_install = true +deps = {[lint]deps} +commands = {[lint]commands} +whitelist_externals = {[lint]whitelist_externals} + +[testenv:lint-py36] +basepython = python3.6 +skip_install = true +deps = {[lint]deps} +commands = {[lint]commands} +whitelist_externals = {[lint]whitelist_externals}