tox.ini 1.91 KB
Newer Older
1
[tox]
2 3
# Don't cover Python 3.7 since this is just a shim for that version.  Do at
# least make sure we don't regress!
4
envlist = {py27,py34,py35,py36}{,-cov,-diffcov},{py37,py38},qa,docs
5 6 7 8 9
skip_missing_interpreters = True


[testenv]
commands =
10
    !cov,!diffcov: python -m unittest discover
11 12 13
    cov,diffcov: python -m coverage run {[coverage]rc} -m unittest discover {posargs}
    cov,diffcov: python -m coverage combine {[coverage]rc}
    cov: python -m coverage html {[coverage]rc}
Barry Warsaw's avatar
Barry Warsaw committed
14
    cov: python -m coverage xml {[coverage]rc}
15 16 17 18 19 20 21 22 23
    cov: python -m coverage report -m {[coverage]rc} --fail-under=100
    diffcov: python -m coverage xml {[coverage]rc}
    diffcov: diff-cover coverage.xml --html-report diffcov.html
    diffcov: diff-cover coverage.xml --fail-under=100
usedevelop = True
passenv =
    PYTHON*
    LANG*
    LC_*
24
    OMIT
25
deps =
26
     cov,diffcov: coverage>=4.5
27 28 29 30 31
     diffcov: diff_cover
setenv =
    cov: COVERAGE_PROCESS_START={[coverage]rcfile}
    cov: COVERAGE_OPTIONS="-p"
    cov: COVERAGE_FILE={toxinidir}/.coverage
32
    py27: OMIT=3
33
    py34,py35,py36,py37,py38: OMIT=2
34 35 36 37 38 39


[testenv:qa]
basepython = python3
commands =
    python -m flake8 importlib_resources
40
    mypy importlib_resources
41
deps =
Barry Warsaw's avatar
Barry Warsaw committed
42
    mypy
43 44 45 46 47 48
    flake8


[testenv:docs]
basepython = python3
commands =
49
    sphinx-build importlib_resources/docs build/sphinx/html
50 51 52 53 54 55 56 57 58 59 60 61 62 63
deps:
    sphinx
    docutils==0.12


[coverage]
rcfile = {toxinidir}/coverage.ini
rc = --rcfile={[coverage]rcfile}


[flake8]
hang-closing = True
jobs = 1
max-line-length = 79
Barry Warsaw's avatar
Barry Warsaw committed
64 65 66 67
exclude =
    # Exclude the entire top-level __init__.py file since its only purpose is
    # to expose the version string and to handle Python 2/3 compatibility.
    importlib_resources/__init__.py
68

69

70 71
[testenv:release]
basepython = python3
72 73 74 75 76 77 78 79 80 81 82
deps =
    twine
    wheel
    setuptools
    keyring
passenv =
    TWINE_USERNAME
    TWINE_PASSWORD
commands =
    python setup.py sdist bdist_wheel
    python -m twine {posargs} upload dist/*