-
Notifications
You must be signed in to change notification settings - Fork 45
Expand file tree
/
Copy pathpyproject.toml
More file actions
332 lines (313 loc) · 8.67 KB
/
pyproject.toml
File metadata and controls
332 lines (313 loc) · 8.67 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
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
[build-system]
requires = ["uv_build>=0.8.12,<0.9.0"]
build-backend = "uv_build"
[dependency-groups]
common = [
"absl-py==2.3.1",
"asttokens==3.0.0",
"blinker==1.9.0",
"bytecode==0.16.2",
"cachetools==5.5.2",
"certifi==2025.8.3",
"charset-normalizer==3.4.2",
"click==7.1.2",
"datadog==0.51.0",
"ddtrace==2.21.11",
"decorator==5.2.1",
"deepmerge==0.3.0",
"dnspython==2.6.1",
"ecdsa==0.19.1",
"envier==0.5.2",
"erlpack",
"executing==2.2.0",
"faker==4.18.0",
"flask==1.1.4",
"gevent==24.2.1",
"google-api-core==2.19.2",
"google-api-python-client==2.105.0",
"google-auth==2.40.3",
"google-auth-httplib2==0.2.0",
"google-cloud-appengine-logging==1.6.2",
"google-cloud-audit-log==0.3.2",
"google-cloud-bigquery==3.27.0",
"google-cloud-bigtable==2.10.0",
"google-cloud-core==2.4.3",
"google-cloud-kms==3.5.1",
"google-cloud-logging==3.4.0",
"google-cloud-pubsub==2.15.2",
"google-cloud-secret-manager==2.24.0",
"google-cloud-storage==2.10.0",
"google-crc32c==1.7.1",
"google-resumable-media==2.7.2",
"googleapis-common-protos==1.70.0",
"graphviz==0.20",
"greenlet",
"grpc-google-iam-v1==0.14.2",
"grpcio==1.49.1; platform_machine == 'x86_64'", # Normal dependency for production
"grpcio==1.53.*; platform_machine == 'aarch64'", # Only install on ARM64 architecture for local development on MacOS
"grpcio-health-checking==1.44.0",
"grpcio-reflection==1.44.0",
"grpcio-status==1.49.1",
"grpcio-tools==1.49.1",
"gunicorn",
"hash-ring",
"httplib2==0.22.0",
"humanize==4.12.3",
"idna==3.10",
"imagehash==4.3.2",
"importlib-metadata==8.7.0",
"infinity==1.5",
"iniconfig==2.1.0",
"intervals==0.9.2",
"ipdb==0.13.13",
"ipython==9.4.0",
"ipython-pygments-lexers==1.1.1",
"iso8601==2.1.0",
"itsdangerous==1.1.0",
"jedi==0.19.2",
"jinja2==2.11.3",
"jslog4kube==1.0.6",
"jsonpath-rw",
"kafka-python==1.4.7",
"linkify-it-py==2.0.3",
"markdown-it-py==3.0.0",
"markupsafe==2.0.1",
"matplotlib-inline==0.1.7",
"maxminddb==1.5.4",
"mdit-py-plugins==0.4.2",
"mdurl==0.1.2",
"memray==1.17.2",
"minio>=7.2.16",
"mmh3==3.0.0",
"msgpack==1.0.8",
"mypy==1.13.0",
"mypy-extensions==1.0.0",
"mypy-protobuf==3.6.0",
"nostril",
"numpy==1.24.4",
"opentelemetry-api==1.36.0",
"packaging==25.0",
"parso==0.8.4",
"pdqhash==0.2.5",
"pexpect==4.9.0",
"phone-iso3166==0.3.8",
"pillow==9.5.0",
"plac==1.4.5",
"platformdirs==4.3.8",
"pluggy==1.5.0",
"ply==3.11",
"prompt-toolkit==3.0.51",
"proto-plus==1.26.1",
"protobuf==4.25.8",
"psycogreen==1.0.2",
"psycopg2-binary==2.9.10",
"ptyprocess==0.7.0",
"pure-eval==0.2.3",
"py==1.11.0",
"pyasn1==0.6.1",
"pyasn1-modules==0.4.2",
"pycryptodome==3.21.0",
"pydantic==1.10.19",
"pydruid==0.6.9",
"pygments==2.19.2",
"pyparsing==3.2.3",
"pytest==8.3.5",
"pytest-flask==1.3.0",
"pytest-mock==3.14.1",
"pytest-order==1.3.0",
"python-dateutil==2.8.0",
"python-jose==3.5.0",
"python-json-logger==0.1.10",
"python-levenshtein==0.12.2",
"pytz==2022.1",
"pywavelets==1.8.0",
"pyyaml==6.0.1",
"requests==2.32.4",
"requests-mock==1.9.3",
"result==0.5.0",
"retry==0.9.2",
"rich==14.1.0",
"rsa==4.9.1",
"scipy==1.15.3",
"sentry-sdk==1.5.12",
"setuptools==80.9.0",
"simplejson==3.19.3",
"six==1.16.0",
"sqlalchemy==1.4.31",
"sqlalchemy-utils==0.41.1",
"sqlalchemy2-stubs==0.0.2a38",
"stack-data==0.6.3",
"tabulate==0.9.0",
"tenacity==8.1.0",
"text-unidecode==1.3",
"textual==5.2.0",
"tink==1.9.0",
"tld==0.12.7",
"traitlets==5.14.3",
"types-cachetools==6.1.0.20250717",
"types-click==7.1.8",
"types-flask==1.1.6",
"types-ipaddress==1.0.8",
"types-jinja2==2.11.9",
"types-markupsafe==1.1.10",
"types-maxminddb==1.5.0",
"types-protobuf==4.24.0.1",
"types-psycopg2>=2.9.21.20250809",
"types-python-dateutil==2.9.0.20250708",
"types-pytz==2025.2.0.20250516",
"types-pyyaml==6.0.12.20250516",
"types-requests==2.27.7",
"types-simplejson==3.20.0.20250326",
"types-six==1.17.0.20250515",
"types-urllib3==1.26.25.14",
"types-werkzeug==1.0.9",
"typing-extensions==4.6.3",
"typing-inspect==0.9.0",
"uc-micro-py==1.0.3",
"unidecode==1.3.8",
"uritemplate==4.2.0",
"urllib3==2.5.0",
"wcwidth==0.2.13",
"werkzeug==1.0.1",
"wrapt==1.17.2",
"xmltodict==0.14.2",
"zipp==3.23.0",
"zope-event==5.1.1",
"zope-interface==7.2",
]
dev = [
"mypy>=1.13.0",
"pre-commit>=4.3.0",
"ruff>=0.12.9",
"sqlalchemy[mypy]>=1.4.31",
"types-flask-cors>=3.0.10",
]
[tool.uv]
override-dependencies = ["ddtrace>=2.17.2,<3.0.0"]
default-groups = ["common", "dev"]
[tool.uv.sources]
erlpack = { git = "https://github.com/discord/erlpack.git", rev = "b25ebd51ae4c097bd7f756fd4e1c841b61bfe50b" }
greenlet = { git = "https://github.com/discord/greenlet.git", rev = "a75d78f1547c74a81134644a179467525a255466" }
gunicorn = { git = "https://github.com/discord/gunicorn.git", rev = "979efdcb918daa536d8923668241c6e6bf1edb58" }
hash-ring = { url = "https://storage.googleapis.com/discord-devops/hash_ring-src-b4b56bc93053881b68b829ee9d1a4871b4aee592.zip" }
jsonpath-rw = { url = "https://github.com/kennknowles/python-jsonpath-rw/archive/6f5647bb3ad2395c20f0191fef07a1df51c9fed8.tar.gz" }
nostril = { url = "https://github.com/casics/nostril/archive/v1.2.0.tar.gz" }
osprey_rpc = { workspace = true }
osprey_worker = { workspace = true }
example_plugins = { workspace = true }
[tool.uv.workspace]
members = [
"osprey_rpc",
"osprey_worker",
"example_plugins",
]
[tool.ruff]
target-version = "py311"
line-length = 120
fix = true
force-exclude = true # Needed for pre-commit to work on staged files
extend-exclude = [
# Exclude protobuf generated files
"**/*_pb2*.py",
"**/*_pb2*.pyi",
]
[tool.ruff.format]
quote-style = "single"
indent-style = "space"
skip-magic-trailing-comma = false
line-ending = "auto"
[tool.ruff.lint]
select = [
"E", # pycodestyle errors
"F", # pyflakes
"I", # isort
"B006", # flake8-bugbear, B006 catches mutable defaults
]
ignore = [
"E501", # Formatter already does a best effort of handling line-length, but some lines just can't be shortened anymore
]
[tool.ruff.lint.isort]
known-first-party = ["osprey_worker", "osprey_rpc", "example_plugins"]
[tool.mypy]
plugins = ["pydantic.mypy", "sqlalchemy.ext.mypy.plugin"]
python_version = "3.11"
namespace_packages = true
explicit_package_bases = true
disable_error_code = ["annotation-unchecked"]
mypy_path = [
"osprey_rpc/src",
"osprey_worker/src",
"example_plugins/src",
]
# Strict mode includes the following flags. When these are all True, they can be replaced with strict mode.
# Mostly disabled to match old config
warn_unused_configs = true
disallow_any_generics = true
disallow_subclassing_any = true
disallow_untyped_calls = false
disallow_untyped_defs = false
disallow_incomplete_defs = false
check_untyped_defs = false
disallow_untyped_decorators = false
warn_redundant_casts = true
warn_return_any = false
no_implicit_reexport = false
strict_equality = false
# Additional checks we want to turn on eventually (disabled for now)
disallow_any_unimported = false
disallow_any_expr = false
disallow_any_decorated = false
disallow_any_explicit = false
warn_unreachable = false
exclude = [
"^.*/venv/.*$",
".*/setup\\.py$",
".*_pb2\\.py$",
".*_pb2\\.pyi$",
".*_pb2_grpc\\.py$",
".*/tests/.*",
".*/test_.*\\.py$",
]
# required until pydantic explicitly exports Extra
[[tool.mypy.overrides]]
module = "pydantic.main"
implicit_reexport = true
[[tool.mypy.overrides]]
module = ["jsonpath_rw", "minio.*"]
ignore_missing_imports = true
# third party packages we don't care about
[[tool.mypy.overrides]]
module = [
"stubs.*",
"pigeon.*",
"google.*",
"perf_tools.*",
"gevent.*",
"grpc.*",
"pydruid.*",
"phone_iso3166.*",
"typing_inspect.*",
"tink.*",
"sqlalchemy_utils.*",
"graphviz.*",
"psycogreen.*",
"hash_ring.*",
"deepmerge.*",
"greenlet.*",
"Levenshtein.*",
"kafka.*",
"pythonjsonlogger.*",
"msgpack.*",
"jose.*",
]
ignore_errors = true
disable_error_code = ["annotation-unchecked", "import-untyped"]
ignore_missing_imports = true
# At least for now, ignore tests.
# TODO: Remove these exclusions once they're fixed
[[tool.mypy.overrides]]
module = "osprey.worker.*.tests.*"
ignore_errors = true
[[tool.mypy.overrides]]
module = ["osprey.rpc.*"]
ignore_errors = true