forked from litestar-org/litestar
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pyproject.toml
412 lines (380 loc) · 11.8 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
[project]
authors = [
{name = "Cody Fincher", email = "cody.fincher@gmail.com"},
{name = "Jacob Coffee", email = "jacob@z7x.org"},
{name = "Janek Nouvertné", email = "provinzkraut@posteo.de"},
{name = "Na'aman Hirschfeld", email = "nhirschfeld@gmail.com"},
{name = "Peter Schutt", email = "peter.github@proton.me"},
]
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 :: 3.12",
"Programming Language :: Python",
"Topic :: Internet :: WWW/HTTP",
"Topic :: Software Development :: Libraries",
"Topic :: Software Development",
"Typing :: Typed",
"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",
]
dependencies = [
"anyio>=3",
"httpx>=0.22",
"importlib-metadata; python_version < \"3.10\"",
"importlib-resources>=5.12.0; python_version < \"3.9\"",
"msgspec>=0.18.2",
"multidict>=6.0.2",
"polyfactory>=2.6.3",
"pyyaml",
"typing-extensions",
"click",
"rich>=13.0.0",
"rich-click",
]
description = "Litestar - A production-ready, highly performant, extensible ASGI API Framework"
keywords = ["api", "rest", "asgi", "litestar", "starlite"]
license = {text = "MIT"}
maintainers = [
{name = "Cody Fincher", email = "cody.fincher@gmail.com"},
{name = "Jacob Coffee", email = "jacob@z7x.org"},
{name = "Janek Nouvertné", email = "provinzkraut@posteo.de"},
{name = "Peter Schutt", email = "peter.github@proton.me"},
]
name = "litestar"
readme = "README.md"
requires-python = ">=3.8,<4.0"
version = "2.4.2"
[project.urls]
Blog = "https://blog.litestar.dev"
Changelog = "https://github.com/litestar-org/litestar/releases/"
Discord = "https://discord.gg/litestar-919193495116337154"
Documentation = "https://docs.litestar.dev/"
Homepage = "https://litestar.dev/"
"Issue Tracker" = "https://github.com/litestar-org/litestar/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc"
Reddit = "https://www.reddit.com/r/LitestarAPI"
Repository = "https://github.com/litestar-org/litestar"
Twitter = "https://twitter.com/LitestarAPI"
[project.optional-dependencies]
annotated-types = ["annotated-types"]
attrs = ["attrs"]
brotli = ["brotli"]
cli = ["jsbeautifier", "uvicorn[standard]", "uvloop>=0.18.0; sys_platform != 'win32'"]
cryptography = ["cryptography"]
full = [
"litestar[annotated-types,attrs,brotli,cli,cryptography,jinja,jwt,mako,minijinja,opentelemetry,piccolo,picologging,prometheus,pydantic,redis,sqlalchemy,standard,structlog]",
]
jinja = ["jinja2>=3.1.2"]
jwt = ["python-jose", "cryptography"]
mako = ["mako>=1.2.4"]
minijinja = ["minijinja>=1.0.0"]
opentelemetry = ["opentelemetry-instrumentation-asgi"]
piccolo = ["piccolo"]
picologging = ["picologging"]
prometheus = ["prometheus-client"]
pydantic = ["pydantic", "email-validator", "pydantic-extra-types"]
redis = ["redis[hiredis]>=4.4.4"]
sqlalchemy = ["advanced-alchemy>=0.2.2,<1.0.0"]
standard = ["jinja2", "jsbeautifier", "uvicorn[standard]", "uvloop>=0.18.0; sys_platform != 'win32'", "fast-query-parsers>=1.0.2"]
structlog = ["structlog"]
[tool.pdm]
ignore_package_warnings = ["sphinx", "slotscheck"]
[tool.pdm.dev-dependencies]
dev = [
"beanie>=1.21.0",
"beautifulsoup4",
"fsspec",
"greenlet",
"hypothesis",
"python-dotenv",
"starlette",
"trio",
"aiosqlite",
"exceptiongroup; python_version < \"3.11\"",
"asyncpg>=0.29.0",
"psycopg[pool,binary]>=3.1.10",
"psycopg2-binary",
]
dev-contrib = ["opentelemetry-sdk", "httpx-sse"]
docs = [
"sphinx>=7.1.2",
"sphinx-autobuild>=2021.3.14",
"sphinx-copybutton>=0.5.2",
"sphinx-toolbox>=3.5.0",
"blacken-docs>=1.16.0",
"sphinx-design>=0.5.0",
"sphinx-click>=4.4.0",
"sphinxcontrib-mermaid>=0.9.2",
"auto-pytabs[sphinx]>=0.4.0",
"litestar-sphinx-theme @ git+https://github.com/litestar-org/litestar-sphinx-theme.git",
]
linting = [
"ruff",
"mypy",
"pre-commit",
"slotscheck",
"sourcery",
"pyright",
"blacken-docs",
"asyncpg-stubs",
"types-beautifulsoup4",
"types-pytest-lazy-fixture",
"types-python-jose",
"types-pyyaml",
"types-redis",
]
test = [
"covdefaults",
"pytest",
"pytest-asyncio",
"pytest-cov",
"pytest-lazy-fixture",
"pytest-mock",
"pytest-rerunfailures",
"pytest-timeout",
"pytest-xdist",
"time-machine",
]
[project.scripts]
litestar = "litestar.__main__:run_cli"
[tool.hatch.metadata]
allow-direct-references = true
[tool.hatch.build.targets.sdist]
include = [
'docs/PYPI_README.md',
'/Makefile',
'/litestar',
'/tests',
'/CHANGELOG.rst',
]
[build-system]
build-backend = "hatchling.build"
requires = ["hatchling"]
[tool.pdm.scripts]
ci = {composite = ["lint", "test"]}
docs-serve = "sphinx-autobuild docs docs/_build/ -j auto --watch litestar --watch docs --watch tests --port 8002"
lint = "pre-commit run --all-files"
test = "pytest tests docs/examples"
[tool.codespell]
ignore-words-list = "selectin"
skip = 'pdm.lock,docs/examples/contrib/sqlalchemy/us_state_lookup.json'
[tool.coverage.run]
concurrency = ["multiprocessing", "thread"]
omit = ["*/tests/*", "*/litestar/plugins/sqlalchemy.py"]
parallel = true
plugins = ["covdefaults"]
source = ["litestar"]
[tool.coverage.report]
exclude_lines = [
'except ImportError\b',
'if VERSION.startswith("1"):',
'if pydantic.VERSION.startswith("1"):',
]
fail_under = 96
[tool.pytest.ini_options]
addopts = "--strict-markers --strict-config --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",
]
xfail_strict = true
[tool.mypy]
packages = ["litestar", "tests"]
plugins = ["pydantic.mypy"]
python_version = "3.8"
disallow_any_generics = false
disallow_untyped_decorators = true
implicit_reexport = false
show_error_codes = true
strict = true
warn_redundant_casts = true
warn_return_any = true
warn_unreachable = true
warn_unused_configs = true
warn_unused_ignores = true
[[tool.mypy.overrides]]
ignore_errors = true
module = ["tests.examples.*", "tests.docker_service_fixtures"]
[[tool.mypy.overrides]]
disallow_untyped_decorators = false
module = ["tests.unit.test_kwargs.test_reserved_kwargs_injection"]
[[tool.mypy.overrides]]
module = ["tests.unit.test_contrib.test_repository"]
strict_equality = false
[[tool.mypy.overrides]]
ignore_missing_imports = true
module = [
"brotli.*",
"fsspec.*",
"jsbeautifier.*",
"pytimeparse.*",
]
[tool.pydantic-mypy]
init_forbid_extra = true
init_typed = true
warn_required_dynamic_aliases = true
warn_untyped_fields = true
[tool.pyright]
disableBytesTypePromotions = true
reportUnnecessaryTypeIgnoreComments = true
exclude = [
"test_apps",
"tools",
"docs",
"tests/examples",
"tests/docker_service_fixtures.py",
"litestar/contrib/pydantic/pydantic_dto_factory.py",
"litestar/contrib/pydantic/pydantic_init_plugin.py",
"tests/unit/test_contrib/test_sqlalchemy.py",
]
include = ["litestar", "tests"]
pythonVersion = "3.8"
[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
"ISC001", # Ruff formatter incompatible
]
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]
"docs/**/*.*" = ["S", "B", "DTZ", "A", "TCH", "ERA", "D", "RET"]
"docs/examples/**" = ["T201"]
"docs/examples/application_hooks/before_send_hook.py" = ["UP006"]
"docs/examples/contrib/sqlalchemy/plugins/**/*.*" = ["UP006"]
"docs/examples/data_transfer_objects**/*.*" = ["UP006"]
"litestar/_openapi/schema_generation/schema.py" = ["C901"]
"litestar/exceptions/*.*" = ["N818"]
"litestar/handlers/**/*.*" = ["N801"]
"litestar/params.py" = ["N802"]
"test_apps/**/*.*" = ["D", "TRY", "EM", "S", "PTH"]
"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"]
"tools/**/*.*" = ["D", "ARG", "EM", "TRY", "G", "FBT"]
[tool.unasyncd]
add_editors_note = true
ruff_fix = true
[tool.unasyncd.files]
"litestar/repository/abc/_async.py" = "litestar/repository/abc/_sync.py"
[tool.unasyncd.per_file_add_replacements."litestar/repository/abc/_async.py"]
"AbstractAsyncRepository" = "AbstractSyncRepository"
"AsyncRepoT" = "SyncRepoT"