-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpyproject.toml
143 lines (125 loc) · 4.88 KB
/
pyproject.toml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
[tool.poetry]
name = "async-pytest"
version = "0.4.3"
description = "fastapi project + testing"
authors = ["Konyukhov Alexander <jesusmisha@gmail.com>"]
readme = "README.md"
[tool.isort]
line_length=120
multi_line_output=3
combine_as_imports=true
include_trailing_comma=true
[tool.ruff]
target-version = "py312"
line-length = 120
[tool.ruff.lint]
extend-select = [
"E", # pycodestyle
"N", # pep8-naming
"D", # pydocstyle
"ANN", # flake8-annotations
"COM", # flake8-commas
"C4", # flake8-comprehensions
"FA", # flake8-future-annotations
"ISC", # flake8-implicit-str-concat
"T20", # flake8-print
"PT", # flake8-pytest-style
"RET", # flake8-return
"SIM", # flake8-simplify
"ARG", # flake8-unused-arguments
"PTH", # flake8-use-pathlib
"FIX", # flake8-fix me
"ERA", # eradicate (Find commented-out code)
"PL", # Pylint
"PERF", # Perflint
]
ignore = [
# pep8-naming (N)
"N812", # Lowercase {name} imported as non-lowercase {asname}
# pydocstyle (D)
"D105", # Missing docstring in magic method
"D202", # No blank lines allowed after function docstring
"D205", # 1 blank line required between summary line and description
"D212", # Multi-line docstring summary should start at the first line
"D301", # Use `r"""` if any backslashes in a docstring
"D415", # First line should end with a period, question mark, or exclamation point
# pycodestyle (E)
"E701", # Multiple statements on one line
"E731", # Do not assign a lambda expression, use a def
# Pyflakes (F)
"F811", # Redefinition of unused {name} from {row} - annotation of imported fixtures
# flake8-annotations (ANN)
"ANN002", # Missing type annotation for *{name} - annotation for args
"ANN003", # Missing type annotation for **{name} - annotation for kwargs
"ANN101", # Missing type annotation for {name} in method - deprecated
"ANN102", # Missing type annotation for {name} in classmethod - deprecated
"ANN204", # Missing return type annotation for special method {name} - annotation for return type in __init__
"ANN401", # Dynamically typed expressions (typing.Any) are disallowed in {name}
# flake8-pytest-style (PT)
"PT001", # Use @pytest.fixture() over @pytest.fixture
"PT004", # Fixture {function} does not return anything, add leading underscore - deprecated
"PT011", # pytest.raises({exception}) is too broad, set the match parameter or use a more specific exception
"PT013", # Incorrect import of pytest; use import pytest instead
"PT023", # Use @pytest.mark.{mark_name}{expected_parens} over @pytest.mark.{mark_name}{actual_parens}
# flake8-return (RET)
"RET503", # Missing explicit `return` at the end of function able to return non-`None` value
"RET505", # Unnecessary `else` after `return` statement
"RET506", # Unnecessary `else` after `raise` statement
# flake8-simplify (SIM)
"SIM117", # Use a single with statement with multiple contexts instead of nested with statements
# flake8-use-pathlib (PTH)
"PTH123", # open() should be replaced by Path.open()
# Pylint (PL)
"PLR0913", # Too many arguments in function definition
"PLR2004", # Magic value used in comparison
]
exclude = [
"*_pb2.py",
"*.yaml"
]
dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?)|needs_allure)$"
[tool.ruff.lint.per-file-ignores]
"__init__.py" = ["F401"] # Ignore `F401` (imported but unused) in all `__init__.py` files`
"dto/*" = ["N815", "N816"] # Ignore `N815`, `N816` (Variable {name} should not be mixedCase) in all dto files
"test_*.py" = [
"D", # Ignore `D` (pydocstyle)
"ANN201", # Ignore `ANN201` (Missing return type annotation)
"ARG" # Ignore `ARG` (flake8-unused-arguments) - fixtures
] # Ignore rules for tests
[tool.ruff.lint.pycodestyle]
max-line-length = 120
[tool.ruff.lint.pydocstyle]
convention = "google"
[tool.ruff.lint.flake8-annotations]
suppress-none-returning = true
[tool.ruff.lint.flake8-pytest-style]
parametrize-names-type = "csv"
[tool.ruff.lint.flake8-unused-arguments]
ignore-variadic-names = true
[tool.poetry.dependencies]
python = "^3.12"
fastapi = "^0.111.0"
pre-commit = "^4.0.1"
python-dotenv = "^1.0.1"
alembic = "^1.14.0"
sqlalchemy = "^2.0.36"
mimesis = "^18.0.0"
[tool.poetry.group.validation.dependencies]
pydantic = "^2.7.1"
[tool.poetry.group.formatting.dependencies]
isort = "^5.13.2"
[tool.poetry.group.type-checking.dependencies]
mypy = "^1.10.0"
[tool.poetry.group.linting.dependencies]
pylint = "^3.1.0"
ruff = "^0.8.1"
[tool.poetry.group.logging.dependencies]
loguru = "^0.7.2"
[tool.poetry.group.report-generation.dependencies]
allure-pytest = "^2.13.5"
[tool.poetry.group.sql.dependencies]
asyncpg = "^0.30.0"
sqlmodel = "^0.0.22"
[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"