From fe4d40bd02b10433991c8f04e748d32ed2d3d851 Mon Sep 17 00:00:00 2001 From: Casper da Costa-Luis Date: Mon, 29 Jan 2018 00:55:06 +0000 Subject: [PATCH] update test framework - travis: fix py37-dev, update pypy{2.7,3.5}-5.8.0 => 5.10.0 - update tox.ini --- .travis.yml | 31 ++++++--------- tox.ini | 109 +++++++++++++++++++++++----------------------------- 2 files changed, 60 insertions(+), 80 deletions(-) diff --git a/.travis.yml b/.travis.yml index 77494ca5..49229e37 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,5 +1,5 @@ -sudo: required -dist: trusty +# sudo: required +# dist: trusty language: python matrix: include: @@ -16,49 +16,40 @@ matrix: - python: 3.6 env: TOXENV=py36 - python: 3.7-dev - env: TOXENV=py37-dev - - python: pypy2.7-5.8.0 + env: TOXENV=py37 + - python: pypy2.7-5.10.0 env: TOXENV=pypy - - python: pypy3.5-5.8.0 + - python: pypy3.5-5.10.0 env: TOXENV=pypy3 - python: 3.6 env: TOXENV=flake8 - python: 2.7 env: TOXENV=perf - -# use cache for big builds like pandas +# use cache for big builds like pandas (to minimise build time). +# If issues, clear cache +# https://docs.travis-ci.com/user/caching/#Clearing-Caches cache: pip: true directories: - $HOME/.cache/pip before_cache: - rm -f $HOME/.cache/pip/log/debug.log - notifications: email: false # branches: # remove travis double-check on pull requests in main repo # only: # - master # - /^\d\.\d+$/ - before_install: # fix a crash with multiprocessing on Travis - - sudo rm -rf /dev/shm - - sudo ln -s /run/shm /dev/shm - # coverage submission packages + # - sudo rm -rf /dev/shm + # - sudo ln -s /run/shm /dev/shm - git fetch --tags - install: # Install tox first, before dependencies (to get per-env deps) - pip install tox - # Install big packages (they are cached to minimize build time) - # if issues, clear cache - # https://docs.travis-ci.com/user/caching/#Clearing-Caches - # - pip install numpy - # - pip install pandas # install this package (tqdm) into the environment - - python setup.py install - + - pip install . # run tests script: - tox diff --git a/tox.ini b/tox.ini index d3958a3b..df3e6dde 100644 --- a/tox.ini +++ b/tox.ini @@ -4,79 +4,75 @@ # and then run "tox" from this directory. [tox] -# deprecation warning: py26, py32-4 -envlist = py26, py27, py33, py34, py35, py36, py37-dev, pypy, pypy3, flake8, setup.py, perf +# deprecation warning: py{26,32,33,34} +envlist = py{26,27,33,34,35,36,37,py,py3}, flake8, setup.py, perf + +[coverage] +deps = + nose + coverage + coveralls +commands = + nosetests --with-coverage --cover-package=tqdm --ignore-files="tests_p(erf|andas)\.py" -d -v tqdm/ + - coveralls + +[extra] +deps = + {[coverage]deps} + nose-timer + codecov +commands = + nosetests --with-coverage --with-timer --cover-package=tqdm --ignore-files="tests_p(erf|andas)\.py" -d -v tqdm/ + - coveralls + codecov [testenv] # default tests (most things) -passenv = TRAVIS TRAVIS_JOB_ID TRAVIS_BRANCH +passenv = CI TRAVIS TRAVIS_* deps = - nose - nose-timer - coverage<4 - coveralls + {[extra]deps} cython numpy pandas commands = nosetests --with-coverage --with-timer --cover-package=tqdm --ignore-files="tests_perf\.py" -d -v tqdm/ - coveralls + codecov + +# no cython/numpy/pandas for py{py,py3,26,33,37} + +[testenv:py26] +# no codecov and timer for py26 +deps = {[coverage]deps} +commands = {[coverage]commands} -# no cython/numpy/pandas for pypy/pypy3/py26/py33/py37-dev [testenv:pypy] -passenv = TRAVIS TRAVIS_JOB_ID TRAVIS_BRANCH +deps = {[extra]deps} +commands = {[extra]commands} + +[testenv:pypy3] +deps = {[extra]deps} +commands = {[extra]commands} + +[testenv:py33] +deps = {[extra]deps} +commands = {[extra]commands} + +[testenv:py37] +deps = {[extra]deps} +commands = {[extra]commands} + +[testenv:perf] deps = nose nose-timer - coverage<4 - coveralls - virtualenv>=15.0.2 commands = - nosetests --with-coverage --cover-package=tqdm --ignore-files="tests_p(erf|andas)\.py" -d -v tqdm/ # TODO: --with-timer - - coveralls - -[testenv:pypy3] -passenv = {[testenv:pypy]passenv} -deps = - {[testenv:pypy]deps} -commands = - {[testenv:pypy]commands} - -[testenv:py26] -passenv = {[testenv:pypy]passenv} -deps = - {[testenv:pypy]deps} -commands = - {[testenv:pypy]commands} - -[testenv:py33] -passenv = {[testenv:pypy]passenv} -deps = - {[testenv:pypy]deps} -commands = - {[testenv:pypy]commands} - -[testenv:py37-dev] -passenv = {[testenv:pypy]passenv} -deps = - {[testenv:pypy]deps} -commands = - {[testenv:pypy]commands} - -[testenv:py27] -# add codecov only for py27 (they spam a lot) -passenv = CI TRAVIS TRAVIS_* -deps = - {[testenv]deps} - codecov -commands = - {[testenv]commands} - codecov + nosetests --with-timer tqdm/tests/tests_perf.py -d -v [testenv:flake8] deps = flake8 commands = - flake8 --max-line-length=80 --count --statistics --exit-zero -j 8 --exclude .tox,.asv . + flake8 --max-line-length=80 -j 8 --count --statistics --exit-zero . [testenv:setup.py] deps = @@ -85,10 +81,3 @@ deps = commands = python setup.py check --restructuredtext --metadata --strict python setup.py make none - -[testenv:perf] -deps = - nose - nose-timer -commands = - nosetests --with-timer tqdm/tests/tests_perf.py -d -v