diff --git a/.gitignore b/.gitignore index 1b5e22b..841e961 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ __pycache__/ venv/ +.tox/ .hypothesis/ .mutmut-cache dist/ diff --git a/tox.ini b/tox.ini new file mode 100644 index 0000000..6830466 --- /dev/null +++ b/tox.ini @@ -0,0 +1,93 @@ +[tox] +requires = tox +labels = + check = flake8, black, test + ci = build, flake8, black_ci, test_ci, mutmut + +[testenv:run] +description = Runs the project +use_develop = true +commands = python -m newlang {posargs} + +[testenv:build] +description = Builds the project +deps = + build + wheel +commands = python -m build + +[testenv:flake8] +description = Runs flake8 +skip_install = true +deps = flake8 +commands = flake8 {posargs:src tests} + +[testenv:black] +description = Runs black +skip_install = true +deps = black +commands = black {posargs:src tests} + +[testenv:black_ci] +description = Runs black in checking mode +deps = black +commands = black --check {posargs:src tests} + +[testenv:test] +description = Tests the project +deps = + pytest + pytest-randomly + pytest-xdist + hypothesis +commands = + pytest -q -n auto -x -l --sw --hypothesis-profile=dev {posargs} + +[testenv:test_dev] +description = Tests the current source tree slowly +use_develop = true +deps = + pytest + pytest-randomly + pytest-xdist + hypothesis +commands = + pytest -vv -n 0 -x -l --sw --hypothesis-profile=dev {posargs} + +[testenv:test_ci] +description = Tests the project for a long time +deps = + pytest + pytest-randomly + pytest-xdist + hypothesis +commands = + pytest -q -n auto -x -l --sw --hypothesis-profile=ci {posargs} + +[testenv:mutmut] +description = Runs mutmut on the source tree +use_develop = true +deps = + pytest + pytest-randomly + pytest-xdist + hypothesis + mutmut +commands = + mutmut run --paths-to-mutate "src/parse2,src/newlang/i18n.py" +commands_post = + mutmut results + +[testenv:mutmut_ci] +description = Runs mutmut on the source tree without progress +use_develop = true +deps = + pytest + pytest-randomly + pytest-xdist + hypothesis + mutmut +commands = + mutmut run --no-progress --paths-to-mutate "src/parse2,src/newlang/i18n.py" +commands_post = + mutmut results