Skip to content

Commit 8a842b0

Browse files
author
Gitar
committed
Rule 19
1 parent 31b6799 commit 8a842b0

File tree

2 files changed

+126
-1
lines changed

2 files changed

+126
-1
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
exclude: "^.venv$|^.cache$|^.pytest_cache$"
33
fail_fast: true
44
default_language_version:
5-
python: python3.9
5+
python: python3.10
66
repos:
77
- repo: https://github.com/pre-commit/pre-commit-hooks
88
rev: v4.2.0

tox.ini

Lines changed: 125 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
[tox]
2+
envlist = py310, py311, py312, lint, type-check
3+
isolated_build = true
4+
skip_missing_interpreters = true
5+
6+
[testenv]
7+
# Install dependencies from requirements files
8+
deps =
9+
pytest
10+
pytest-asyncio
11+
pytest-cov
12+
pytest-mock
13+
commands =
14+
pytest {posargs}
15+
setenv =
16+
PYTHONPATH = {toxinidir}
17+
COVERAGE_FILE = {toxworkdir}/.coverage.{envname}
18+
19+
[testenv:py310]
20+
basepython = python3.10
21+
deps =
22+
pytest
23+
pytest-asyncio
24+
pytest-cov
25+
pytest-mock
26+
commands =
27+
pytest {posargs}
28+
29+
[testenv:py311]
30+
basepython = python3.11
31+
deps =
32+
pytest
33+
pytest-asyncio
34+
pytest-cov
35+
pytest-mock
36+
commands =
37+
pytest {posargs}
38+
39+
[testenv:py312]
40+
basepython = python3.12
41+
deps =
42+
pytest
43+
pytest-asyncio
44+
pytest-cov
45+
pytest-mock
46+
commands =
47+
pytest {posargs}
48+
49+
[testenv:lint]
50+
basepython = python3.10
51+
deps =
52+
black
53+
isort
54+
pylint
55+
flake8
56+
commands =
57+
# Run linting tools
58+
black --check .
59+
isort --check-only .
60+
flake8 .
61+
pylint src/
62+
63+
[testenv:type-check]
64+
basepython = python3.10
65+
deps =
66+
mypy
67+
types-requests
68+
commands =
69+
mypy src/
70+
71+
[testenv:coverage]
72+
basepython = python3.10
73+
deps =
74+
pytest
75+
pytest-asyncio
76+
pytest-cov
77+
pytest-mock
78+
coverage[toml]
79+
commands =
80+
coverage combine
81+
coverage report
82+
coverage html
83+
coverage xml
84+
85+
[testenv:docs]
86+
basepython = python3.10
87+
deps =
88+
sphinx
89+
sphinx-rtd-theme
90+
sphinx-autodoc-typehints
91+
commands =
92+
sphinx-build -b html docs/ docs/_build/html
93+
94+
[flake8]
95+
max-line-length = 88
96+
extend-ignore = E203, W503
97+
exclude =
98+
.git,
99+
__pycache__,
100+
.tox,
101+
.venv,
102+
.coverage,
103+
*.egg-info,
104+
build,
105+
dist
106+
107+
[coverage:run]
108+
source = src/
109+
parallel = true
110+
branch = true
111+
112+
[coverage:report]
113+
show_missing = true
114+
precision = 2
115+
exclude_lines =
116+
pragma: no cover
117+
def __repr__
118+
if self.debug:
119+
if settings.DEBUG
120+
raise AssertionError
121+
raise NotImplementedError
122+
if 0:
123+
if __name__ == .__main__.:
124+
class .*\bProtocol\):
125+
@(abc\.)?abstractmethod

0 commit comments

Comments
 (0)