2013-12-19 15:51:33 +00:00
|
|
|
|
[tox]
|
2020-09-07 17:58:35 +00:00
|
|
|
|
minversion = 2.4
|
2020-04-26 20:07:00 +00:00
|
|
|
|
envlist = py35, py36, py37, py38, pypy, pylint, benchmark
|
2015-12-14 15:56:33 +00:00
|
|
|
|
skip_missing_interpreters = true
|
2015-03-03 21:13:25 +00:00
|
|
|
|
|
|
|
|
|
[testenv:pylint]
|
|
|
|
|
deps =
|
2017-08-09 13:14:00 +00:00
|
|
|
|
git+https://github.com/pycqa/astroid@master
|
2019-10-31 08:53:03 +00:00
|
|
|
|
pytest
|
2020-04-20 10:30:48 +00:00
|
|
|
|
commands =
|
|
|
|
|
# This would be greatly simplified by a solution for https://github.com/PyCQA/pylint/issues/352
|
2020-05-01 12:07:08 +00:00
|
|
|
|
pylint -rn --rcfile={toxinidir}/pylintrc --load-plugins=pylint.extensions.docparams, pylint.extensions.mccabe \
|
|
|
|
|
{toxinidir}/pylint \
|
2020-04-26 15:46:42 +00:00
|
|
|
|
{toxinidir}/tests/message/ \
|
2020-04-26 15:41:15 +00:00
|
|
|
|
{toxinidir}/tests/checkers/ \
|
2020-04-26 15:46:42 +00:00
|
|
|
|
{toxinidir}/tests/extensions/ \
|
|
|
|
|
{toxinidir}/tests/utils/ \
|
|
|
|
|
{toxinidir}/tests/acceptance/ \
|
|
|
|
|
{toxinidir}/tests/conftest.py \
|
|
|
|
|
{toxinidir}/tests/test_config.py \
|
|
|
|
|
{toxinidir}/tests/test_func.py \
|
|
|
|
|
{toxinidir}/tests/test_functional.py \
|
|
|
|
|
{toxinidir}/tests/test_import_graph.py \
|
|
|
|
|
{toxinidir}/tests/test_pragma_parser.py \
|
|
|
|
|
{toxinidir}/tests/test_pylint_runners.py \
|
|
|
|
|
{toxinidir}/tests/test_regr.py \
|
|
|
|
|
{toxinidir}/tests/test_self.py \
|
|
|
|
|
{toxinidir}/tests/unittest_config.py \
|
|
|
|
|
{toxinidir}/tests/lint/ \
|
|
|
|
|
{toxinidir}/tests/unittest_pyreverse_diadefs.py \
|
|
|
|
|
{toxinidir}/tests/unittest_pyreverse_inspector.py \
|
|
|
|
|
{toxinidir}/tests/unittest_pyreverse_writer.py \
|
|
|
|
|
{toxinidir}/tests/unittest_reporters_json.py \
|
|
|
|
|
{toxinidir}/tests/unittest_reporting.py
|
2018-09-17 07:07:02 +00:00
|
|
|
|
|
|
|
|
|
[testenv:formatting]
|
|
|
|
|
basepython = python3
|
2019-03-19 19:44:59 +00:00
|
|
|
|
deps =
|
2020-09-10 20:52:59 +00:00
|
|
|
|
black==20.8b1
|
|
|
|
|
isort==5.5.2
|
2019-03-19 19:44:59 +00:00
|
|
|
|
commands =
|
2020-04-20 09:21:50 +00:00
|
|
|
|
black --check . --exclude="tests/functional/|tests/input|tests/extensions/data|tests/regrtest_data/|tests/data/|venv|astroid|.tox"
|
2020-07-05 22:01:50 +00:00
|
|
|
|
isort . --check-only
|
2018-09-17 07:07:02 +00:00
|
|
|
|
changedir = {toxinidir}
|
|
|
|
|
|
2018-07-23 17:20:58 +00:00
|
|
|
|
[testenv:mypy]
|
|
|
|
|
basepython = python3
|
|
|
|
|
deps =
|
2019-09-30 08:00:44 +00:00
|
|
|
|
typed-ast>=1.4
|
|
|
|
|
mypy>=0.7,<1.0
|
2018-07-23 17:20:58 +00:00
|
|
|
|
|
|
|
|
|
commands =
|
2019-09-30 08:00:44 +00:00
|
|
|
|
python -m mypy {toxinidir}/pylint/checkers --ignore-missing-imports {posargs:}
|
2018-07-23 17:20:58 +00:00
|
|
|
|
|
2013-12-19 15:51:33 +00:00
|
|
|
|
[testenv]
|
|
|
|
|
deps =
|
2018-02-04 16:19:25 +00:00
|
|
|
|
https://github.com/PyCQA/astroid/tarball/master#egg=astroid-master-2.0
|
2019-12-15 10:59:14 +00:00
|
|
|
|
coverage<5.0
|
2016-05-09 08:56:34 +00:00
|
|
|
|
mccabe
|
2020-07-05 21:06:04 +00:00
|
|
|
|
# isort 5 is not compatible with Python 3.5
|
|
|
|
|
py35: isort>=4.2.5,<5
|
2016-12-02 17:09:18 +00:00
|
|
|
|
pytest
|
2016-12-30 15:53:05 +00:00
|
|
|
|
pytest-xdist
|
2020-04-26 20:07:00 +00:00
|
|
|
|
pytest-benchmark
|
2020-04-02 21:32:20 +00:00
|
|
|
|
pytest-profiling
|
2015-11-07 16:16:06 +00:00
|
|
|
|
|
2016-04-26 13:53:30 +00:00
|
|
|
|
setenv =
|
|
|
|
|
COVERAGE_FILE = {toxinidir}/.coverage.{envname}
|
|
|
|
|
|
|
|
|
|
commands =
|
2020-04-26 20:07:00 +00:00
|
|
|
|
; Run tests, ensuring all benchmark tests do not run
|
|
|
|
|
python -Wignore -m coverage run -m pytest --benchmark-disable {toxinidir}/tests/ {posargs:}
|
2016-04-26 13:53:30 +00:00
|
|
|
|
|
|
|
|
|
; Transform absolute path to relative path
|
|
|
|
|
; for compatibility with coveralls.io and fix 'source not available' error.
|
|
|
|
|
; If you can find a cleaner way is welcome
|
|
|
|
|
python -c "import os;cov_strip_abspath = open(os.environ['COVERAGE_FILE'], 'r').read().replace('.tox' + os.sep + os.path.relpath('{envsitepackagesdir}', '{toxworkdir}') + os.sep, '');open(os.environ['COVERAGE_FILE'], 'w').write(cov_strip_abspath)"
|
2015-11-07 16:09:00 +00:00
|
|
|
|
changedir = {toxworkdir}
|
2016-04-26 13:53:30 +00:00
|
|
|
|
|
2018-09-29 08:30:45 +00:00
|
|
|
|
|
|
|
|
|
[testenv:spelling]
|
|
|
|
|
deps =
|
|
|
|
|
https://github.com/PyCQA/astroid/tarball/master#egg=astroid-master-2.0
|
|
|
|
|
pytest
|
|
|
|
|
pytest-xdist
|
|
|
|
|
pyenchant
|
|
|
|
|
|
|
|
|
|
commands =
|
2020-04-27 12:20:20 +00:00
|
|
|
|
python -Wi -m pytest {toxinidir}/tests/ {posargs:} -k unittest_spelling
|
2018-09-29 08:30:45 +00:00
|
|
|
|
|
|
|
|
|
changedir = {toxworkdir}
|
|
|
|
|
|
2016-04-26 13:53:30 +00:00
|
|
|
|
[testenv:coveralls]
|
|
|
|
|
setenv =
|
|
|
|
|
COVERAGE_FILE = {toxinidir}/.coverage
|
|
|
|
|
passenv =
|
|
|
|
|
*
|
|
|
|
|
deps =
|
2019-12-15 10:59:14 +00:00
|
|
|
|
coverage<5.0
|
2016-04-26 13:53:30 +00:00
|
|
|
|
coveralls
|
|
|
|
|
skip_install = true
|
|
|
|
|
commands =
|
2020-04-03 12:39:52 +00:00
|
|
|
|
python -m coverage combine
|
|
|
|
|
python -m coverage report --rcfile={toxinidir}/.coveragerc -m
|
2016-04-26 13:53:30 +00:00
|
|
|
|
- coveralls --rcfile={toxinidir}/.coveragerc
|
|
|
|
|
changedir = {toxinidir}
|
|
|
|
|
|
|
|
|
|
[testenv:coverage-erase]
|
|
|
|
|
setenv =
|
|
|
|
|
COVERAGE_FILE = {toxinidir}/.coverage
|
|
|
|
|
deps =
|
2019-12-15 10:59:14 +00:00
|
|
|
|
coverage<5
|
2016-04-26 13:53:30 +00:00
|
|
|
|
skip_install = true
|
|
|
|
|
commands =
|
2020-04-03 12:39:52 +00:00
|
|
|
|
python -m coverage erase
|
2016-04-26 13:53:30 +00:00
|
|
|
|
changedir = {toxinidir}
|
2018-06-04 17:35:34 +00:00
|
|
|
|
|
2020-03-30 15:17:02 +00:00
|
|
|
|
[testenv:coverage-html]
|
|
|
|
|
setenv =
|
|
|
|
|
COVERAGE_FILE = {toxinidir}/.coverage
|
|
|
|
|
deps =
|
|
|
|
|
coverage<5
|
|
|
|
|
skip_install = true
|
|
|
|
|
commands =
|
|
|
|
|
python -m coverage combine
|
|
|
|
|
python -m coverage html --ignore-errors --rcfile={toxinidir}/.coveragerc
|
|
|
|
|
changedir = {toxinidir}
|
|
|
|
|
|
2018-06-04 17:35:34 +00:00
|
|
|
|
[testenv:docs]
|
|
|
|
|
usedevelop = True
|
|
|
|
|
changedir = doc/
|
2020-09-07 17:58:35 +00:00
|
|
|
|
extras =
|
|
|
|
|
docs
|
2018-06-04 17:35:34 +00:00
|
|
|
|
commands =
|
2018-07-31 16:16:46 +00:00
|
|
|
|
sphinx-build -W -b html -d _build/doctrees . _build/html
|
2020-04-26 20:07:00 +00:00
|
|
|
|
|
|
|
|
|
[testenv:benchmark]
|
|
|
|
|
deps =
|
|
|
|
|
https://github.com/PyCQA/astroid/tarball/master#egg=astroid-master-2.0
|
|
|
|
|
coverage<5.0
|
|
|
|
|
mccabe
|
|
|
|
|
pytest
|
|
|
|
|
pytest-xdist
|
|
|
|
|
pygal
|
|
|
|
|
pytest-benchmark
|
|
|
|
|
|
|
|
|
|
commands =
|
|
|
|
|
; Run the only the benchmark tests, grouping output and forcing .json output so we
|
|
|
|
|
; can compare benchmark runs
|
|
|
|
|
python -Wi -m pytest --exitfirst \
|
|
|
|
|
--failed-first \
|
|
|
|
|
--benchmark-only \
|
|
|
|
|
--benchmark-save=batch_files \
|
|
|
|
|
--benchmark-save-data \
|
|
|
|
|
--benchmark-autosave \
|
|
|
|
|
{toxinidir}/tests \
|
|
|
|
|
--benchmark-group-by="group" \
|
|
|
|
|
{posargs:}
|
|
|
|
|
|
|
|
|
|
changedir = {toxworkdir}
|