-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathpyproject.toml
More file actions
250 lines (229 loc) · 9.76 KB
/
pyproject.toml
File metadata and controls
250 lines (229 loc) · 9.76 KB
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
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[project]
name = "app"
version = "1.0.0"
description = "Escape Python Template Project"
authors = [{ name = "Escape Technologies SAS", email = "ping@escape.tech" }]
requires-python = ">=3.13,<3.14"
readme = "README.md"
license = "MIT"
maintainers = [{ name = "Antoine Carossio", email = "antoine@escape.tech" }]
dependencies = ["pydantic"]
[project.urls]
Homepage = "https://escape.tech/"
Repository = "https://github.com/Escape-Technologies/python-project-template"
[project.scripts]
app-cli = "app:main"
[dependency-groups]
dev = [
"mypy",
"ruff",
"toml",
"pytest",
"pytest-cov",
"pytest-mock",
"pytest-benchmark",
"pytest-xdist",
"pytest-asyncio",
"pytest-timeout",
"pytest-dotenv",
"types-requests",
"types-toml",
"types-jsonschema",
"yamllint",
"mdformat",
"gitlint",
]
[tool.hatch.build.targets.sdist]
include = ["app"]
[tool.hatch.build.targets.wheel]
include = ["app"]
[tool.ruff]
exclude = [".venv", "uv.lock", "__pycache__", "pyproject.toml"]
line-length = 120
target-version = "py313"
[tool.ruff.lint]
unfixable = ["F841"]
ignore = [
"UP015",
"S311",
"S101",
"E501",
"PYI041",
"SIM103",
"SIM108",
"SIM110",
"TD003",
"COM812",
"ISC001",
"ASYNC109",
"G003",
"G004",
"PERF401",
"PERF403",
"PLR2004",
"PLR0911",
"PLR0912",
"PLR0913",
"PLR0914",
"PLR0915",
"PLR0916",
"PLR0917",
"TRY002",
"TRY003",
"TRY300",
"TRY301",
"N802",
"N803",
"N805",
"N806",
"N815",
"N812",
]
task-tags = ["TODO"]
select = [
## Here are all available rules
# https://docs.astral.sh/ruff/rules/
# Please, comment or uncomment lines but do not remove them
"AIR", # Airflow https://docs.astral.sh/ruff/rules/#airflow-air
# "ERA", # eradicate https://docs.astral.sh/ruff/rules/#eradicate-era
"FAST", # fastapi https://docs.astral.sh/ruff/rules/#fastapi-fast
"YTT", # flake8-2020 https://docs.astral.sh/ruff/rules/#flake8-2020-ytt
# "ANN", # flake8-annotations https://docs.astral.sh/ruff/rules/#flake8-annotations-ann
"ASYNC", # flake8-async https://docs.astral.sh/ruff/rules/#flake8-async-async
"S", # flake8-bandit https://docs.astral.sh/ruff/rules/#flake8-bandit-s
# "BLE", # flake8-blind-except https://docs.astral.sh/ruff/rules/#flake8-blind-except-ble
# "FBT", # flake8-boolean-trap https://docs.astral.sh/ruff/rules/#flake8-boolean-trap-fbt
"B", # flake8-bugbear https://docs.astral.sh/ruff/rules/#flake8-bugbear-b
"A", # flake8-builtins https://docs.astral.sh/ruff/rules/#flake8-builtins-a
"COM", # flake8-commas https://docs.astral.sh/ruff/rules/#flake8-commas-com
"C4", # flake8-comprehensions https://docs.astral.sh/ruff/rules/#flake8-comprehensions-c4
# "CPY", # flake8-copyright https://docs.astral.sh/ruff/rules/#flake8-copyright-cpy
"DTZ", # flake8-datetimez https://docs.astral.sh/ruff/rules/#flake8-datetimez-dtz
"T10", # flake8-debugger https://docs.astral.sh/ruff/rules/#flake8-debugger-t10
# "DJ", # flake8-django https://docs.astral.sh/ruff/rules/#flake8-django-dj
# "EM", # flake8-errmsg https://docs.astral.sh/ruff/rules/#flake8-errmsg-em
"EXE", # flake8-executable https://docs.astral.sh/ruff/rules/#flake8-executable-exe
# "FIX", # flake8-fixme https://docs.astral.sh/ruff/rules/#flake8-fixme-fix
"FA", # flake8-future-annotations https://docs.astral.sh/ruff/rules/#flake8-future-annotations-fa
"INT", # flake8-gettext-int https://docs.astral.sh/ruff/rules/#flake8-gettext-int
"ISC", # flake8-implicit-str-concat https://docs.astral.sh/ruff/rules/#flake8-implicit-str-concat-isc
"ICN", # flake8-import-conventions https://docs.astral.sh/ruff/rules/#flake8-import-conventions-icn
"LOG", # flake8-logging https://docs.astral.sh/ruff/rules/#flake8-logging-log
"G", # flake8-logging-format https://docs.astral.sh/ruff/rules/#flake8-logging-format-g
"INP", # flake8-no-pep420 https://docs.astral.sh/ruff/rules/#flake8-no-pep420-inp
"PIE", # flake8-pie https://docs.astral.sh/ruff/rules/#flake8-pie-pie
"T20", # flake8-print https://docs.astral.sh/ruff/rules/#flake8-print-t20
"PYI", # flake8-pyi https://docs.astral.sh/ruff/rules/#flake8-pyi-pyi
"PT", # flake8-pytest-style https://docs.astral.sh/ruff/rules/#flake8-pytest-style-pt
"Q", # flake8-quotes https://docs.astral.sh/ruff/rules/#flake8-quotes-q
"RSE", # flake8-raise https://docs.astral.sh/ruff/rules/#flake8-raise-rse
"RET", # flake8-return https://docs.astral.sh/ruff/rules/#flake8-return-ret
"SLF", # flake8-self https://docs.astral.sh/ruff/rules/#flake8-self-slf
"SIM", # flake8-simplify https://docs.astral.sh/ruff/rules/#flake8-simplify-sim
"SLOT", # flake8-slots https://docs.astral.sh/ruff/rules/#flake8-slots-slot
"TID", # flake8-tidy-imports https://docs.astral.sh/ruff/rules/#flake8-tidy-imports-tid
"TD", # flake8-todos (TD) https://docs.astral.sh/ruff/rules/#flake8-todos-td
"TC", # flake8-type-checking https://docs.astral.sh/ruff/rules/#flake8-type-checking-tc
"ARG", # flake8-unused-arguments https://docs.astral.sh/ruff/rules/#flake8-unused-arguments-arg
# "PTH", # flake8-use-pathlib https://docs.astral.sh/ruff/rules/#flake8-use-pathlib-pth
# "FLY", # flynt https://docs.astral.sh/ruff/rules/#flynt-fly
"I", # isort https://docs.astral.sh/ruff/rules/#isort-i
"C90", # mccabe https://docs.astral.sh/ruff/rules/#mccabe-c90
# "NPY", # numpy https://docs.astral.sh/ruff/rules/#numpy-specific-rules-npy
# "PD", # pandas-vet https://docs.astral.sh/ruff/rules/#pandas-vet-pd
"N", # pep8-naming https://docs.astral.sh/ruff/rules/#pep8-naming-n
"PERF", # perflint https://docs.astral.sh/ruff/rules/#perflint-perf
"E", # pycodestyle - Error https://docs.astral.sh/ruff/rules/#error-e
"W", # pycodestyle - Warning https://docs.astral.sh/ruff/rules/#warning-w
# "DOC", # pydoclint-doc https://docs.astral.sh/ruff/rules/#pydoclint-doc
# "D", # pydocstyle https://docs.astral.sh/ruff/rules/#pydocstyle-d
"F", # Pyflakes https://docs.astral.sh/ruff/rules/#pyflakes-f
"PGH", # pygrep-hooks https://docs.astral.sh/ruff/rules/#pygrep-hooks-pgh
"PL", # Pylint https://docs.astral.sh/ruff/rules/#pylint-pl
"UP", # pyupgrade https://docs.astral.sh/ruff/rules/#pyupgrade-up
"FURB", # flake8-refurb https://docs.astral.sh/ruff/rules/#refurb-furb
"RUF", # Ruff-specific rules https://docs.astral.sh/ruff/rules/#ruff-specific-rules-ruf
"TRY", # tryceratops https://docs.astral.sh/ruff/rules/#tryceratops-try
]
[tool.ruff.lint.pydocstyle]
convention = "google"
[tool.ruff.format]
quote-style = "preserve"
[tool.ruff.lint.flake8-quotes]
docstring-quotes = "double"
inline-quotes = "single"
[tool.ruff.lint.per-file-ignores]
"__init__.py" = [
"F401", # Module imported but unused
"F403", # 'from module import *' used; unable to detect undefined names
]
"*/test/*" = [
"INP001", # is part of an implicit namespace package, missing __init__.py
"SLF001", # accessing to a private attribute in a test is ok
"S106", # Harcoded password
]
"*/test_*.py" = [
"INP001",
"SLF001", # accessing to a private attribute in a test is ok,
"S106", # Harcoded password
]
"*/*_test.py" = [
"INP001",
"SLF001", # accessing to a private attribute in a test is ok
"S106", # Harcoded password
]
"*/scripts/*" = [
"INP001", # is part of an implicit namespace package, missing __init__.py
]
"*/migrations/*" = [
"INP001", # Alembic is a set of scripts
"S608", # SQL migrations
]
[tool.ruff.lint.pycodestyle]
max-doc-length = 160
ignore-overlong-task-comments = true
[tool.ruff.lint.mccabe]
max-complexity = 10
[tool.ruff.lint.pylint]
max-args = 4
max-branches = 5
max-statements = 5
[tool.mypy]
python_version = "3.13"
disallow_untyped_defs = true
disallow_untyped_calls = true
disallow_incomplete_defs = true
disallow_untyped_decorators = true
no_implicit_optional = false
strict_equality = true
show_error_codes = true
warn_unreachable = true
warn_redundant_casts = true
warn_unused_ignores = true
warn_unused_configs = true
namespace_packages = true
pretty = true
files = "app, tests"
exclude = [
".venv",
"setup.py",
".git",
".tox",
"dist",
"build",
"docs",
"node_modules",
"__pycache__",
]
[tool.coverage.run]
parallel = true
omit = ["_test.py"]
[tool.pytest.ini_options]
addopts = []
filterwarnings = [
"ignore:Module already imported.*:pytest.PytestAssertRewriteWarning",
"ignore::DeprecationWarning",
]