2013-12-19 15:51:33 +00:00
|
|
|
|
[tox]
|
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
|
2016-04-30 11:07:15 +00:00
|
|
|
|
isort
|
2019-10-31 08:53:03 +00:00
|
|
|
|
pytest
|
2020-04-20 10:30:48 +00:00
|
|
|
|
commands =
|
|
|
|
|
pylint -rn --rcfile={toxinidir}/pylintrc --load-plugins=pylint.extensions.docparams, pylint.extensions.mccabe {envsitepackagesdir}/pylint
|
|
|
|
|
# This would be greatly simplified by a solution for https://github.com/PyCQA/pylint/issues/352
|
|
|
|
|
pylint -rn --rcfile={toxinidir}/tests/.test_pylintrc --load-plugins=pylint.extensions.docparams, pylint.extensions.mccabe \
|
2020-04-26 15:46:42 +00:00
|
|
|
|
{toxinidir}/tests/message/ \
|
|
|
|
|
{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_checker_base.py \
|
|
|
|
|
{toxinidir}/tests/unittest_checker_classes.py \
|
|
|
|
|
{toxinidir}/tests/unittest_checker_exceptions.py \
|
|
|
|
|
{toxinidir}/tests/unittest_checker_format.py \
|
|
|
|
|
{toxinidir}/tests/unittest_checker_imports.py \
|
|
|
|
|
{toxinidir}/tests/unittest_checker_logging.py \
|
|
|
|
|
{toxinidir}/tests/unittest_checker_misc.py \
|
|
|
|
|
{toxinidir}/tests/unittest_checker_python3.py \
|
|
|
|
|
{toxinidir}/tests/unittest_checker_similar.py \
|
|
|
|
|
{toxinidir}/tests/unittest_checker_spelling.py \
|
|
|
|
|
{toxinidir}/tests/unittest_checker_stdlib.py \
|
|
|
|
|
{toxinidir}/tests/unittest_checker_strings.py \
|
|
|
|
|
{toxinidir}/tests/unittest_checkers_utils.py \
|
|
|
|
|
{toxinidir}/tests/unittest_checker_typecheck.py \
|
|
|
|
|
{toxinidir}/tests/unittest_checker_variables.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 =
|
2019-11-17 21:27:05 +00:00
|
|
|
|
black==19.10b0
|
|
|
|
|
isort==4.3.21
|
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-04-20 09:38:24 +00:00
|
|
|
|
isort -rc . --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-04-30 11:07:15 +00:00
|
|
|
|
isort
|
2016-05-09 08:56:34 +00:00
|
|
|
|
mccabe
|
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 =
|
2019-06-15 05:28:42 +00:00
|
|
|
|
python -Wi -m pytest {toxinidir}/tests/ {posargs:} -k unittest_checker_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]
|
|
|
|
|
skipsdist = True
|
|
|
|
|
usedevelop = True
|
|
|
|
|
changedir = doc/
|
|
|
|
|
whitelist_externals = rm
|
|
|
|
|
deps =
|
2019-03-29 08:33:36 +00:00
|
|
|
|
sphinx==2.0
|
2018-06-05 02:22:28 +00:00
|
|
|
|
python-docs-theme
|
2018-06-04 17:35:34 +00:00
|
|
|
|
|
|
|
|
|
commands =
|
2018-06-05 15:18:24 +00:00
|
|
|
|
pip install python_docs_theme
|
2018-06-04 17:35:34 +00:00
|
|
|
|
rm -f features.rst
|
|
|
|
|
python ./exts/pylint_features.py
|
|
|
|
|
rm -f extensions.rst
|
|
|
|
|
python ./exts/pylint_extensions.py
|
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
|
|
|
|
|
isort
|
|
|
|
|
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}
|