forked from litestar-org/litestar
-
Notifications
You must be signed in to change notification settings - Fork 1
/
pyproject.toml
451 lines (415 loc) · 13.7 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
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
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
[tool.poetry]
name = "litestar"
version = "2.0.0"
description = "Litestar - A production-ready, highly performant, extensible ASGI API Framework"
authors = [
"Na'aman Hirschfeld <[email protected]>",
"Peter Schutt <[email protected]>",
"Cody Fincher <[email protected]>",
"Janek Nouvertné <[email protected]>",
"Jacob Coffee <[email protected]>",
]
maintainers = [
"Na'aman Hirschfeld <[email protected]>",
"Cody Fincher <[email protected]>",
"Janek Nouvertné <[email protected]>",
"Jacob Coffee <[email protected]>",
]
license = "MIT"
readme = "docs/PYPI_README.md"
homepage = "https://litestar.dev/"
repository = "https://github.com/litestar-org/litestar"
documentation = "https://docs.litestar.dev/"
keywords = [
"api",
"rest",
"asgi",
"litestar",
"starlite",
]
classifiers = [
"Development Status :: 5 - Production/Stable",
"Environment :: Web Environment",
"License :: OSI Approved :: MIT License",
"Natural Language :: English",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python",
"Topic :: Internet :: WWW/HTTP",
"Topic :: Software Development :: Libraries",
"Topic :: Software Development",
"Typing :: Typed",
"Framework :: AsyncIO",
# Pending trove-classifiers#148
# "Framework :: Litestar",
# "Framework :: Litestar :: 2",
"Framework :: Pydantic",
"Framework :: Pydantic :: 1",
"Intended Audience :: Developers",
"Intended Audience :: Information Technology",
"Intended Audience :: System Administrators",
"Topic :: Internet",
"Topic :: Internet :: WWW/HTTP :: HTTP Servers",
"Topic :: Software Development :: Libraries :: Application Frameworks",
"Topic :: Software Development :: Libraries :: Python Modules",
]
include = ["CHANGELOG.rst"]
packages = [{ include = "litestar" }]
[tool.poetry.urls]
"Issue Tracker" = "https://github.com/litestar-org/litestar/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc"
"Changelog" = "https://github.com/litestar-org/litestar/releases/"
"Twitter" = "https://twitter.com/LitestarAPI"
"Reddit" = "https://www.reddit.com/r/litestarapi"
"Discord" = "https://discord.gg/MmcwxztmQb"
"Blog" = "https://blog.litestar.dev"
[tool.poetry.dependencies]
python = ">=3.8,<4.0"
alembic = { version = "*", optional = true }
annotated-types = { version = "*", optional = true }
anyio = ">=3"
attrs = { version = "*", optional = true }
brotli = { version = "*", optional = true }
click = { version = "*", optional = true }
cryptography = { version = "*", optional = true }
fast-query-parsers = ">=1.0.2"
httpx = ">=0.22"
importlib-metadata = { version = "*", python = "<3.10" }
importlib-resources = { version = ">=5.12.0", python = "<3.9" }
jinja2 = { version = ">=3.1.2", optional = true }
jsbeautifier = { version = "*", optional = true }
mako = { version = ">=1.2.4", optional = true }
msgspec = ">=0.18.2"
multidict = ">=6.0.2"
opentelemetry-instrumentation-asgi = { version = "*", optional = true }
piccolo = { version = "*", optional = true }
picologging = { version = "*", optional = true }
polyfactory = ">=2.6.3"
prometheus-client = { version = "*", optional = true }
pydantic = { version = "*", optional = true, extras = ["email"] }
pydantic-extra-types = { version = "*", optional = true }
python-jose = { version = "*", optional = true }
pyyaml = "*"
redis = { version = ">=4.4.4", optional = true, extras = ["hiredis"] }
rich = { version = ">=13.0.0", optional = true }
rich-click = { version = "*", optional = true }
sqlalchemy = { version = ">=2.0.12", optional = true }
structlog = { version = "*", optional = true }
typing-extensions = "*"
uvicorn = { extras = ["standard"], version = ">=0.22.0", optional = true }
[tool.poetry.group.dev.dependencies]
aiosqlite = "*"
asyncmy = "*"
asyncpg = "*"
beautifulsoup4 = "*"
duckdb-engine = "*"
fsspec = "*"
greenlet = "*"
httpx-sse = "*"
hypothesis = "*"
opentelemetry-sdk = "*"
oracledb = "*"
psycopg = "*"
pytest = "*"
pytest-asyncio = "*"
pytest-cov = "*"
pytest-lazy-fixture = "*"
pytest-mock = "*"
pytest-rerunfailures = "*"
pytest-timeout = "*"
pytest-xdist = "*"
python-dotenv = "*"
sqlalchemy-spanner = "*"
starlette = "*"
time-machine = "*"
trio = "*"
[tool.poetry.group.docs]
optional = true
[tool.poetry.group.docs.dependencies]
auto-pytabs = { extras = ["sphinx"], version = "*" }
black = "*"
sphinx = ">=5.3.0,<=6"
sphinx-autobuild = "*"
sphinx-copybutton = ">=0.5.1"
sphinx-design = ">=0.3.0,<1"
sphinxcontrib-mermaid = ">=0.8.1,<1"
litestar-sphinx-theme = { git = "https://github.com/litestar-org/litestar-sphinx-theme.git" }
sphinx-click = ">=4.4.0"
[tool.poetry.group.lint]
optional = true
[tool.poetry.group.lint.dependencies]
asyncpg-stubs = "*"
black = "*"
blacken-docs = "*"
mypy = "*"
pre-commit = "*"
pyright = "*"
ruff = '*'
slotscheck = "*"
sourcery = "*"
types-beautifulsoup4 = "*"
types-python-jose = "*"
types-pyyaml = "*"
types-redis = "*"
[tool.poetry.extras]
annotated-types = ["annotated-types"]
attrs = ["attrs"]
brotli = ["brotli"]
cli = ["click", "rich", "rich-click", "jsbeautifier", "uvicorn"]
cryptography = ["cryptography"]
jinja = ["jinja2"]
jwt = ["python-jose", "cryptography"]
mako = ["mako"]
opentelemetry = ["opentelemetry-instrumentation-asgi"]
piccolo = ["piccolo"]
picologging = ["picologging"]
prometheus = ["prometheus-client"]
pydantic = ["pydantic", "pydantic-extra-types"]
redis = ["redis"]
sqlalchemy = ["sqlalchemy", "alembic"]
standard = ["click", "jinja2", "jsbeautifier", "rich", "uvicorn", "rich-click"]
structlog = ["structlog"]
full = [
"alembic",
"annotated-types",
"attrs",
"brotli",
"click",
"rich-click",
"cryptography",
"jinja2",
"jsbeautifier",
"mako",
"opentelemetry-instrumentation-asgi",
"piccolo",
"picologging",
"prometheus-client",
"pydantic",
"pydantic-extra-types",
"python-jose",
"redis",
"rich",
"sqlalchemy",
"structlog",
"uvicorn",
]
[tool.poetry.scripts]
litestar = { callable = "litestar.__main__:run_cli", extras = ["cli"] }
[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"
[tool.black]
line-length = 120
include = '\.pyi?$'
[tool.codespell]
ignore-words-list = "selectin"
skip = 'poetry.lock,docs/examples/contrib/sqlalchemy/us_state_lookup.json'
[tool.coverage.run]
omit = ["*/tests/*"]
parallel = true
concurrency = ["multiprocessing", "thread"]
[tool.coverage.report]
exclude_lines = [
'pragma: no cover',
'if TYPE_CHECKING:',
'except ImportError as e:',
'except ImportError:',
'\.\.\.',
'raise NotImplementedError',
'if VERSION.startswith("1"):',
'if pydantic.VERSION.startswith("1"):',
]
[tool.pytest.ini_options]
addopts = "-m='not sqlalchemy_integration' --dist=loadgroup"
asyncio_mode = "auto"
filterwarnings = [
"ignore::trio.TrioDeprecationWarning:anyio._backends._trio*:",
"ignore::DeprecationWarning:pkg_resources.*",
"ignore::DeprecationWarning:google.rpc",
"ignore::DeprecationWarning:google.gcloud",
"ignore::DeprecationWarning:google.iam",
"ignore::DeprecationWarning:google",
"ignore::DeprecationWarning:sphinxcontrib",
"ignore::DeprecationWarning:litestar.*",
"ignore:The `__fields__` attribute is deprecated:DeprecationWarning:pydantic*",
"ignore:Support for class-based `config` is deprecated:DeprecationWarning:pydantic*",
"ignore:The `dict` method is deprecated:DeprecationWarning:",
"ignore:The `parse_obj` method is deprecated:DeprecationWarning:",
"ignore:The `json` method is deprecated:DeprecationWarning:",
"ignore:Extra keyword arguments on `Field` is deprecated:DeprecationWarning:pydantic*",
]
markers = [
"sqlalchemy_integration: SQLAlchemy integration tests",
"sqlalchemy_asyncmy: SQLAlchemy MySQL (asyncmy) Tests",
"sqlalchemy_asyncpg: SQLAlchemy Postgres (asyncpg) Tests",
"sqlalchemy_psycopg_async: SQLAlchemy Postgres (psycopg async) Tests",
"sqlalchemy_aiosqlite: SQLAlchemy SQLite (aiosqlite) Tests",
"sqlalchemy_psycopg_sync: SQLAlchemy Postgres (psycopg sync) Tests",
"sqlalchemy_sqlite: SQLAlchemy SQLite (sqlite) Tests",
"sqlalchemy_oracledb: SQLAlchemy Oracle (oracledb) Tests",
"sqlalchemy_spanner: SQLAlchemy Google Cloud Spanner (sqlalchemy-spanner) Tests",
"sqlalchemy_duckdb: SQLAlchemy Duckdb (duckdb-engine) Tests",
]
[tool.mypy]
plugins = ["pydantic.mypy"]
warn_unused_ignores = true
warn_redundant_casts = true
warn_unused_configs = true
warn_unreachable = true
warn_return_any = true
strict = true
disallow_untyped_decorators = true
disallow_any_generics = false
implicit_reexport = false
show_error_codes = true
[[tool.mypy.overrides]]
module = ["tests.*.test_sqlalchemy", "tests.*.test_sqlalchemy"]
disable_error_code = "attr-defined"
[[tool.mypy.overrides]]
module = "tests.unit.test_contrib.test_sqlalchemy.test_dto"
disable_error_code = ["arg-type", "misc", "valid-type", "var-annotated"]
[[tool.mypy.overrides]]
module = "tests.*"
disallow_untyped_decorators = false
[[tool.mypy.overrides]]
module = ["mako.*", "pytimeparse.*", "brotli.*", "jsbeautifier.*"]
ignore_missing_imports = true
[tool.pydantic-mypy]
init_forbid_extra = true
init_typed = true
warn_required_dynamic_aliases = true
warn_untyped_fields = true
[tool.pyright]
include = ["litestar", "tests", "examples"]
exclude = [
"examples/plugins/sqlalchemy_plugin",
"litestar/openapi",
"tests/unit/test_contrib/test_sqlalchemy/test_dto.py",
]
[tool.slotscheck]
strict-imports = false
[tool.ruff]
select = [
"A", # flake8-builtins
"B", # flake8-bugbear
"BLE", # flake8-blind-except
"C4", # flake8-comprehensions
"C90", # mccabe
"D", # pydocstyle
"DJ", # flake8-django
"DTZ", # flake8-datetimez
"E", # pycodestyle errors
"ERA", # eradicate
"EXE", # flake8-executable
"F", # pyflakes
"G", # flake8-logging-format
"I", # isort
"ICN", # flake8-import-conventions
"ISC", # flake8-implicit-str-concat
"N", # pep8-naming
"PIE", # flake8-pie
"PLC", # pylint - convention
"PLE", # pylint - error
"PLW", # pylint - warning
"PTH", # flake8-use-pathlib
"Q", # flake8-quotes
"RET", # flake8-return
"RUF", # Ruff-specific rules
"S", # flake8-bandit
"SIM", # flake8-simplify
"T10", # flake8-debugger
"T20", # flake8-print
"TCH", # flake8-type-checking
"TID", # flake8-tidy-imports
"UP", # pyupgrade
"W", # pycodestyle - warning
"YTT", # flake8-2020
]
ignore = [
"A003", # flake8-builtins - class attribute {name} is shadowing a python builtin
"B010", # flake8-bugbear - do not call setattr with a constant attribute value
"D100", # pydocstyle - missing docstring in public module
"D101", # pydocstyle - missing docstring in public class
"D102", # pydocstyle - missing docstring in public method
"D103", # pydocstyle - missing docstring in public function
"D104", # pydocstyle - missing docstring in public package
"D105", # pydocstyle - missing docstring in magic method
"D106", # pydocstyle - missing docstring in public nested class
"D107", # pydocstyle - missing docstring in __init__
"D202", # pydocstyle - no blank lines allowed after function docstring
"D205", # pydocstyle - 1 blank line required between summary line and description
"D415", # pydocstyle - first line should end with a period, question mark, or exclamation point
"E501", # pycodestyle line too long, handled by black
"PLW2901", # pylint - for loop variable overwritten by assignment target
"RUF012", # Ruff-specific rule - annotated with classvar
]
line-length = 120
src = ["litestar", "tests", "docs/examples"]
target-version = "py38"
[tool.ruff.pydocstyle]
convention = "google"
[tool.ruff.mccabe]
max-complexity = 12
[tool.ruff.pep8-naming]
classmethod-decorators = [
"classmethod",
"pydantic.root_validator",
"pydantic.validator",
"sqlalchemy.ext.declarative.declared_attr",
"sqlalchemy.orm.declared_attr.directive",
"sqlalchemy.orm.declared_attr",
]
[tool.ruff.isort]
known-first-party = ["litestar", "tests", "examples"]
[tool.ruff.per-file-ignores]
"tests/**/*.*" = [
"A",
"ARG",
"B",
"BLE",
"C901",
"D",
"DTZ",
"EM",
"FBT",
"G",
"N",
"PGH",
"PIE",
"PLR",
"PLW",
"PTH",
"RSE",
"S",
"S101",
"SIM",
"TCH",
"TRY",
]
"tests/unit/test_contrib/test_sqlalchemy/**/*.*" = ["UP006"]
"docs/examples/application_hooks/before_send_hook.py" = ["UP006"]
"docs/examples/contrib/sqlalchemy/plugins/**/*.*" = ["UP006"]
"docs/**/*.*" = ["S", "B", "DTZ", "A", "TCH", "ERA", "D", "RET"]
"docs/examples/**" = ["T201"]
"docs/examples/data_transfer_objects**/*.*" = ["UP006"]
"litestar/exceptions/*.*" = ["N818"]
"litestar/handlers/**/*.*" = ["N801"]
"litestar/_openapi/schema_generation/schema.py" = ["C901"]
"litestar/params.py" = ["N802"]
"test_apps/**/*.*" = ["D", "TRY", "EM", "S", "PTH"]
"tools/**/*.*" = ["D", "ARG", "EM", "TRY", "G", "FBT"]
[tool.unasyncd]
add_editors_note = true
ruff_fix = true
[tool.unasyncd.files]
"litestar/contrib/sqlalchemy/repository/_async.py" = "litestar/contrib/sqlalchemy/repository/_sync.py"
"litestar/contrib/repository/abc/_async.py" = "litestar/contrib/repository/abc/_sync.py"
[tool.unasyncd.per_file_add_replacements."litestar/contrib/repository/abc/_async.py"]
"AbstractAsyncRepository" = "AbstractSyncRepository"
"AsyncRepoT" = "SyncRepoT"
[tool.unasyncd.per_file_add_replacements."litestar/contrib/sqlalchemy/repository/_async.py"]
SQLAlchemyAsyncRepository = "SQLAlchemySyncRepository"
"sqlalchemy.ext.asyncio.AsyncSession" = "sqlalchemy.orm.Session"
"litestar.contrib.repository.AbstractAsyncRepository" = "litestar.contrib.repository.AbstractSyncRepository"