| 1 | [tox] |
| 2 | envlist = |
| 3 | {py37,py38,py39,py310} |
| 4 | linting |
| 5 | publish |
| 6 | |
| 7 | [testenv] |
| 8 | deps = |
| 9 | coverage |
| 10 | hypothesis |
| 11 | isodate |
| 12 | pytest |
| 13 | pytest-benchmark |
| 14 | commands = |
| 15 | coverage run -m pytest {posargs} |
| 16 | coverage report |
| 17 | coverage xml |
| 18 | |
| 19 | [testenv:linting] |
| 20 | deps = |
| 21 | isodate |
| 22 | bandit |
| 23 | black |
| 24 | dlint |
| 25 | flake8 |
| 26 | flake8-bugbear |
| 27 | isort<5 |
| 28 | mypy |
| 29 | pylint |
| 30 | commands = |
| 31 | flake8 src/isoduration tests |
| 32 | pylint src/isoduration |
| 33 | mypy --strict --no-error-summary src/isoduration |
| 34 | black -q --check src/isoduration tests |
| 35 | isort -rc -c src/isoduration |
| 36 | bandit -qr src/isoduration |
| 37 | |
| 38 | [testenv:publish] |
| 39 | skip_install = true |
| 40 | passenv = |
| 41 | TWINE_REPOSITORY_URL |
| 42 | TWINE_USERNAME |
| 43 | TWINE_PASSWORD |
| 44 | deps = |
| 45 | wheel |
| 46 | setuptools |
| 47 | twine |
| 48 | commands = |
| 49 | python setup.py sdist bdist_wheel clean --all |
| 50 | - twine upload --non-interactive dist/* |
| 51 | |
| 52 | |
| 53 | [pytest] |
| 54 | addopts = -ra |
| 55 | testpaths = tests |
| 56 | |
| 57 | [coverage:run] |
| 58 | branch = true |
| 59 | source = isoduration |
| 60 | |
| 61 | [coverage:paths] |
| 62 | source = |
| 63 | src/isoduration |
| 64 | .tox/*/lib/python*/site-packages/isoduration |
| 65 | |
| 66 | [coverage:report] |
| 67 | exclude_lines = |
| 68 | pragma: no cover |
| 69 | def __repr__ |
| 70 | if self.debug: |
| 71 | if settings.DEBUG |
| 72 | raise AssertionError |
| 73 | raise NotImplementedError |
| 74 | if 0: |
| 75 | if __name__ == .__main__.: |
| 76 | fail_under = 98 |
| 77 | precision = 2 |
| 78 | show_missing = true |
| 79 | |
| 80 | [flake8] |
| 81 | max-line-length = 88 |
| 82 | max-complexity = 15 |
| 83 | select = C,E,F,W,B,B950 |
| 84 | ignore = E203, E501, W503 |
| 85 | |
| 86 | [isort] |
| 87 | line_length = 88 |
| 88 | known_first_party = isoduration |
| 89 | # Vertical Hanging Indent. |
| 90 | multi_line_output = 3 |
| 91 | include_trailing_comma = true |
| 92 | use_parentheses = true |