Repository navigation
Expand file tree
/
Copy pathpyproject.toml
More file actions
240 lines (225 loc) · 5.76 KB
/
Copy pathpyproject.toml
File metadata and controls
240 lines (225 loc) · 5.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
# ___ _ ____ _
# | _ \ ___ _ _ _ __ __| |/ ___|__ _| | _____
# | |_) / _ \| | | | '_ \ / _` | | / _` | |/ / _ \
# | __/ (_) | |_| | | | | (_| | |__| (_| | < __/
# |_| \___/ \__,_|_| |_|\__,_|\____\__,_|_|\_\___|
#
[build-system]
requires = ["setuptools>=64.0.0", "wheel"]
build-backend = "setuptools.build_meta"
[project]
name = "poundcake-api"
dynamic = ["version"]
description = "FastAPI application for processing Alertmanager webhooks with StackStorm integration"
license = {file = "LICENSE"}
requires-python = ">=3.11"
classifiers = [
"License :: OSI Approved :: Apache Software License",
]
dependencies = [
"click>=8.4.2,<9.0.0",
"fastapi>=0.128.7,<0.129.0",
"uvicorn[standard]>=0.51.0,<0.52.0",
"sqlalchemy>=2.0.51,<3.0.0",
"GitPython>=3.1.50,<4.0.0",
"greenlet>=3.5.3,<4.0.0",
"pymysql>=1.2.0,<2.0.0",
"aiomysql>=0.3.2,<0.4.0",
"cryptography>=46.0.7,<47.0.0",
"ldap3>=2.9.1,<3.0.0",
"requests>=2.34.2,<3.0.0",
"httpx>=0.28.1,<0.29.0",
"jsonschema>=4.26.0,<5.0.0",
"pydantic>=2.13.4,<3.0.0",
"pydantic-settings>=2.14.2,<3.0.0",
"python-jose[cryptography]>=3.5.0,<4.0.0",
"python-json-logger>=4.1.0,<5.0.0",
"python-multipart>=0.0.32,<0.1.0",
"python-dateutil>=2.9.0.post0,<3.0.0",
"PyYAML>=6.0.3,<7.0.0",
"prometheus-client>=0.25.0,<0.26.0",
"slowapi>=0.1.10,<0.2.0",
"kubernetes>=35.0.0,<36.0.0",
]
[project.scripts]
cakectl = "cli.main:main"
[project.optional-dependencies]
dev = [
"pytest>=8.4.2,<9.0.0",
"pytest-asyncio>=0.26.0,<0.27.0",
"pytest-cov>=6.3.0,<7.0.0",
"httpx>=0.28.1,<0.29.0",
"black>=26.1.0,<27.0.0",
"ruff>=0.15.21,<0.16.0",
"mypy>=1.20.2,<2.0.0",
"pre-commit>=3.8.0,<4.0.0",
"types-PyYAML>=6.0.12.20260518,<7.0.0",
"types-requests>=2.33.0.20260518,<3.0.0",
"types-python-dateutil>=2.9.0.20260518,<3.0.0",
"pytest-mock>=3.15.1,<4.0.0",
"pyright>=1.1.411,<2.0.0",
"yamllint>=1.38.0,<2.0.0",
]
[tool.setuptools.packages.find]
where = ["."]
include = ["api*", "cli*", "shared*"]
[tool.setuptools.dynamic]
version = {attr = "shared.version.__version__"}
[tool.ruff]
line-length = 100
target-version = "py311"
[tool.mypy]
python_version = "3.11"
warn_return_any = true
warn_unused_configs = true
disallow_untyped_defs = true
[[tool.mypy.overrides]]
module = [
"api.api.*",
"api.main",
]
# API layer operates on untyped JSON payloads and dynamic dispatch; suppress the
# systemic error codes consistent with the other api.* overrides.
disallow_untyped_defs = false
disable_error_code = [
"union-attr",
"arg-type",
"dict-item",
"attr-defined",
"index",
"call-overload",
"no-any-return",
"return-value",
"assignment",
"misc",
"operator",
"no-redef",
"valid-type",
"list-item",
"call-arg",
]
[[tool.mypy.overrides]]
module = [
"api.services.*",
]
# Ignore SQLAlchemy Column assignment issues
warn_return_any = false
disallow_untyped_defs = false
# Disable problematic error codes for SQLAlchemy ORM code
disable_error_code = ["assignment", "arg-type", "call-overload", "misc", "var-annotated", "dict-item", "type-var", "return-value", "union-attr", "index", "call-arg", "attr-defined"]
[[tool.mypy.overrides]]
module = ["api.core.*"]
# Ignore pythonjsonlogger, SQLAlchemy type issues, httpx client builder annotations,
# and the untyped-JSON / dynamic-dispatch patterns across the core layer.
disallow_untyped_defs = false
disable_error_code = [
"union-attr",
"arg-type",
"dict-item",
"attr-defined",
"index",
"call-overload",
"no-any-return",
"return-value",
"assignment",
"misc",
"operator",
"no-redef",
"valid-type",
"list-item",
"call-arg",
]
[[tool.mypy.overrides]]
module = [
"api.api.health",
"api.api.routes",
"api.api.recipes",
"api.api.auth",
"api.api.dishes",
"api.models.models",
"api.validation.query_params",
]
# Ignore SQLAlchemy type issues and untyped-JSON / dynamic-dispatch patterns in API modules
disallow_untyped_defs = false
disable_error_code = [
"union-attr",
"arg-type",
"dict-item",
"attr-defined",
"index",
"call-overload",
"no-any-return",
"return-value",
"assignment",
"misc",
"operator",
"no-redef",
"valid-type",
"list-item",
"call-arg",
"var-annotated",
]
[[tool.mypy.overrides]]
module = [
"api.plugins.*",
"cli.*",
"kitchen.*",
]
# The service-plugin rewrite introduces broad untyped-JSON handling (JsonValue /
# JSONObject unions), dynamic adapter dispatch, and CLI/kitchen orchestration.
# Suppress the systemic error codes consistent with the api.services.* override.
disallow_untyped_defs = false
disable_error_code = [
"union-attr",
"arg-type",
"dict-item",
"attr-defined",
"index",
"call-overload",
"no-any-return",
"return-value",
"assignment",
"misc",
"operator",
"no-redef",
"valid-type",
"list-item",
"call-arg",
]
[[tool.mypy.overrides]]
module = [
"kubernetes",
"kubernetes.*",
"git",
"git.*",
"jsonschema",
]
ignore_missing_imports = true
[tool.pytest.ini_options]
testpaths = ["tests"]
asyncio_mode = "auto"
markers = [
"integration: marks tests as integration tests (require running server and database)",
]
filterwarnings = [
"ignore:'asyncio\\.iscoroutinefunction' is deprecated and slated for removal in Python 3\\.16; use inspect\\.iscoroutinefunction\\(\\) instead:DeprecationWarning:slowapi\\.extension",
]
# Skip integration tests by default in CI
addopts = "-v --strict-markers"
[tool.black]
line-length = 100
target-version = ['py311']
include = '\.pyi?$'
extend-exclude = '''
/(
# directories
\.eggs
| \.git
| \.hg
| \.mypy_cache
| \.tox
| \.venv
| build
| dist
)/
'''