From 1fce8c4dc6183333627b28ccececefd8b70c1b90 Mon Sep 17 00:00:00 2001 From: mkranna Date: Mon, 20 Feb 2023 14:37:44 +0000 Subject: [PATCH] Tox.ini --- .../{{cookiecutter.target_id}}/tox.ini | 53 +++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 cookiecutter/target-template/{{cookiecutter.target_id}}/tox.ini diff --git a/cookiecutter/target-template/{{cookiecutter.target_id}}/tox.ini b/cookiecutter/target-template/{{cookiecutter.target_id}}/tox.ini new file mode 100644 index 000000000..5f20123c6 --- /dev/null +++ b/cookiecutter/target-template/{{cookiecutter.target_id}}/tox.ini @@ -0,0 +1,53 @@ +# This file can be used to customize tox tests as well as other test frameworks like flake8 and mypy + +[tox] +envlist = py38 +; envlist = py37, py38, py39 +isolated_build = true + +[testenv] +allowlist_externals = poetry + +commands = + poetry install -v + poetry run pytest + poetry run black --check {{cookiecutter.library_name}}/ + poetry run flake8 {{cookiecutter.library_name}} + poetry run pydocstyle {{cookiecutter.library_name}} + poetry run mypy {{cookiecutter.library_name}} --exclude='{{cookiecutter.library_name}}/tests' + +[testenv:pytest] +# Run the python tests. +# To execute, run `tox -e pytest` +envlist = py37, py38, py39 +commands = + poetry install -v + poetry run pytest + +[testenv:format] +# Attempt to auto-resolve lint errors before they are raised. +# To execute, run `tox -e format` +commands = + poetry install -v + poetry run black {{cookiecutter.library_name}}/ + poetry run isort {{cookiecutter.library_name}} + +[testenv:lint] +# Raise an error if lint and style standards are not met. +# To execute, run `tox -e lint` +commands = + poetry install -v + poetry run black --check --diff {{cookiecutter.library_name}}/ + poetry run isort --check {{cookiecutter.library_name}} + poetry run flake8 {{cookiecutter.library_name}} + # refer to mypy.ini for specific settings + poetry run mypy {{cookiecutter.library_name}} --exclude='{{cookiecutter.library_name}}/tests' + +[flake8] +docstring-convention = google +ignore = W503 +max-line-length = 88 +max-complexity = 10 + +[pydocstyle] +ignore = D105,D203,D213