tox.ini
[tox]
# Keep report as a last env, so 'make detox' can pick it as run separately
envlist = clean, {py35,py36}-{latest,frozen}, check, docs, spell, report
[travis]
python =
3.3: py33
3.4: py34
3.5: py35
3.6: py36
3.7: py37
2.7: py27
[travis:env]
REQUIREMENTS =
frozen: frozen
latest: latest
[testenv]
# necessary to make cov find the .coverage file
# see http://blog.ionelmc.ro/2014/05/25/python-packaging/
usedevelop = true
passenv =
FAKTUROWNIA_API_TOKEN
FAKTUROWNIA_EXISTING_PRODUCT_ID
FAKTUROWNIA_SANDBOX_ENABLED
setenv =
PYTHONPATH = {toxinidir}
commands =
# Run ceoverate on package setup test to reliably recreate env
coverage run --source src --parallel-mode setup.py test
# Uncomment there to fail quicly or if coverage won't be combined
# coverage report
# coverage xml
# Pytest without coverage
# pytest --basetemp = {envtmpdir} tests
# Pytest with coverage
# coverage run --source src -m pytest --basetemp={envtmpdir}
# Pytest with pytest-cov
# pytest --cov=src --cov-append --basetemp={envtmpdir} tests
deps =
latest: coverage
latest: -r{toxinidir}/requirements/testing.txt
frozen: -r{toxinidir}/requirements/lock/development.txt
basepython =
py36: python3.6
py35: python3.5
py34: python3.4
py33: python3.3
py27: python2.7
# https://blog.ionelmc.ro/2014/05/25/python-packaging/#ci-templates-tox-ini
# https://hynek.me/articles/testing-packaging/
{docs,spell}: python3.5
{bootstrap,clean,check,report,extension-coveralls,coveralls,codecov}: python3.5
[testenv:spell]
setenv =
SPELLCHECK = 1
commands =
sphinx-build -b spelling docs dist/docs
extras = factories
skip_install = true
usedevelop = false
deps =
-rrequirements/base.txt
-rrequirements/development.txt
[testenv:docs]
extras = factories
deps =
-rrequirements/base.txt
-rrequirements/development.txt
commands =
sphinx-build {posargs: -E} -b html docs dist/docs
sphinx-build -b linkcheck docs dist/docs
[testenv:check]
deps =
docutils
check-manifest
flake8
readme-renderer
pygments
isort
skip_install = true
usedevelop = false
commands =
python setup.py check --strict --metadata --restructuredtext
check-manifest --ignore .idea,.idea/* {toxinidir}
flake8 src tests example_project setup.py
isort --verbose --check-only --diff --recursive src tests setup.py
[testenv:report]
deps =
coverage
pytest
pytest-cov
skip_install = true
usedevelop = false
commands =
# TODO: coverage combine needs work
# py.test --cov-report html
coverage combine --append
coverage report
coverage html
[testenv:clean]
commands = coverage erase
skip_install = true
usedevelop = false
deps = coverage
[pytest]
python_files = tests.py test_*.py *_tests.py
addopts = --color=yes -v -rsxX --doctest-modules --doctest-glob='README.rst'
;addopts = -s --color=yes -v --doctest-modules --doctest-glob='README.rst'
;addopts = --capture=no
;addopts = -n8
testpaths = tests src README.rst
python_classes = *Tests
doctest_optionflags = ELLIPSIS
[isort]
;known_first_party = fakturownia
known_localfolder = fakturownia,test,tests,test_data
;forced_separate = fakturownia
# This is a workaround for tox putting libraries in firstparty
default_section = THIRDPARTY
line_length = 200
not_skip = __init__.py
skip = migrations
;skip-glob = */migrations/*
# Uncomment these is you have problems indetifying sections
;import_heading_stdlib = Standard Library
;import_heading_firstparty = My Stuff
;import_heading_thirdparty = Thirt party libraries
;import_heading_localfolder = Local