starmallow 0.8.0__tar.gz → 0.9.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {starmallow-0.8.0 → starmallow-0.9.1}/.editorconfig +1 -1
- {starmallow-0.8.0 → starmallow-0.9.1}/.pre-commit-config.yaml +14 -14
- starmallow-0.9.1/.python-version +1 -0
- {starmallow-0.8.0 → starmallow-0.9.1}/PKG-INFO +14 -13
- {starmallow-0.8.0 → starmallow-0.9.1}/examples/sample_server.py +20 -2
- {starmallow-0.8.0 → starmallow-0.9.1}/pyproject.toml +61 -19
- starmallow-0.9.1/starmallow/__init__.py +17 -0
- {starmallow-0.8.0 → starmallow-0.9.1}/starmallow/applications.py +196 -232
- {starmallow-0.8.0 → starmallow-0.9.1}/starmallow/background.py +1 -1
- {starmallow-0.8.0 → starmallow-0.9.1}/starmallow/concurrency.py +8 -7
- {starmallow-0.8.0 → starmallow-0.9.1}/starmallow/dataclasses.py +11 -10
- {starmallow-0.8.0 → starmallow-0.9.1}/starmallow/datastructures.py +1 -1
- {starmallow-0.8.0 → starmallow-0.9.1}/starmallow/decorators.py +31 -30
- {starmallow-0.8.0 → starmallow-0.9.1}/starmallow/delimited_field.py +37 -15
- {starmallow-0.8.0 → starmallow-0.9.1}/starmallow/docs.py +5 -5
- {starmallow-0.8.0 → starmallow-0.9.1}/starmallow/endpoint.py +103 -81
- {starmallow-0.8.0 → starmallow-0.9.1}/starmallow/endpoints.py +3 -2
- {starmallow-0.8.0 → starmallow-0.9.1}/starmallow/exceptions.py +3 -3
- {starmallow-0.8.0 → starmallow-0.9.1}/starmallow/ext/marshmallow/openapi.py +11 -14
- {starmallow-0.8.0 → starmallow-0.9.1}/starmallow/fields.py +3 -3
- starmallow-0.9.1/starmallow/generics.py +34 -0
- starmallow-0.9.1/starmallow/middleware/__init__.py +1 -0
- {starmallow-0.8.0 → starmallow-0.9.1}/starmallow/middleware/asyncexitstack.py +1 -2
- {starmallow-0.8.0 → starmallow-0.9.1}/starmallow/params.py +20 -21
- {starmallow-0.8.0 → starmallow-0.9.1}/starmallow/request_resolver.py +62 -58
- {starmallow-0.8.0 → starmallow-0.9.1}/starmallow/responses.py +5 -4
- {starmallow-0.8.0 → starmallow-0.9.1}/starmallow/routing.py +231 -239
- {starmallow-0.8.0 → starmallow-0.9.1}/starmallow/schema_generator.py +98 -52
- {starmallow-0.8.0 → starmallow-0.9.1}/starmallow/security/api_key.py +10 -10
- {starmallow-0.8.0 → starmallow-0.9.1}/starmallow/security/base.py +11 -3
- {starmallow-0.8.0 → starmallow-0.9.1}/starmallow/security/http.py +29 -24
- {starmallow-0.8.0 → starmallow-0.9.1}/starmallow/security/oauth2.py +47 -47
- {starmallow-0.8.0 → starmallow-0.9.1}/starmallow/security/open_id_connect_url.py +6 -6
- {starmallow-0.8.0 → starmallow-0.9.1}/starmallow/security/utils.py +2 -5
- {starmallow-0.8.0 → starmallow-0.9.1}/starmallow/serializers.py +59 -63
- starmallow-0.9.1/starmallow/types.py +24 -0
- {starmallow-0.8.0 → starmallow-0.9.1}/starmallow/utils.py +108 -68
- {starmallow-0.8.0 → starmallow-0.9.1}/starmallow/websockets.py +3 -6
- {starmallow-0.8.0 → starmallow-0.9.1}/tests/basic_api.py +7 -7
- {starmallow-0.8.0 → starmallow-0.9.1}/tests/security/api_key/test_api_key_cookie_optional.py +1 -3
- {starmallow-0.8.0 → starmallow-0.9.1}/tests/security/api_key/test_api_key_header_optional.py +2 -4
- {starmallow-0.8.0 → starmallow-0.9.1}/tests/security/api_key/test_api_key_query_optional.py +2 -4
- {starmallow-0.8.0 → starmallow-0.9.1}/tests/security/http/test_http_base_optional.py +1 -3
- {starmallow-0.8.0 → starmallow-0.9.1}/tests/security/http/test_http_basic.py +1 -2
- {starmallow-0.8.0 → starmallow-0.9.1}/tests/security/http/test_http_bearer_optional.py +1 -3
- {starmallow-0.8.0 → starmallow-0.9.1}/tests/security/http/test_http_digest_optional.py +1 -3
- {starmallow-0.8.0 → starmallow-0.9.1}/tests/security/oauth2/test_oauth2.py +1 -1
- {starmallow-0.8.0 → starmallow-0.9.1}/tests/security/oauth2/test_oauth2_authorization_code_bearer.py +1 -3
- {starmallow-0.8.0 → starmallow-0.9.1}/tests/security/oauth2/test_oauth2_authorization_code_bearer_description.py +1 -3
- {starmallow-0.8.0 → starmallow-0.9.1}/tests/security/oauth2/test_oauth2_optional.py +3 -5
- {starmallow-0.8.0 → starmallow-0.9.1}/tests/security/oauth2/test_oauth2_optional_description.py +3 -5
- {starmallow-0.8.0 → starmallow-0.9.1}/tests/security/oauth2/test_oauth2_password_bearer_optional.py +1 -3
- {starmallow-0.8.0 → starmallow-0.9.1}/tests/security/oauth2/test_oauth2_password_bearer_optional_description.py +1 -3
- starmallow-0.9.1/tests/security/openid_connect/__init__.py +0 -0
- {starmallow-0.8.0 → starmallow-0.9.1}/tests/security/openid_connect/test_openid_connect_optional.py +2 -4
- {starmallow-0.8.0 → starmallow-0.9.1}/tests/test_additional_properties.py +1 -3
- {starmallow-0.8.0 → starmallow-0.9.1}/tests/test_additional_responses_custom_validationerror.py +2 -4
- {starmallow-0.8.0 → starmallow-0.9.1}/tests/test_additional_responses_default_validationerror.py +1 -1
- {starmallow-0.8.0 → starmallow-0.9.1}/tests/test_additional_responses_response_class.py +1 -3
- {starmallow-0.8.0 → starmallow-0.9.1}/tests/test_annotated.py +8 -8
- {starmallow-0.8.0 → starmallow-0.9.1}/tests/test_basic_api.py +1 -2
- {starmallow-0.8.0 → starmallow-0.9.1}/tests/test_dataclass_fields.py +3 -4
- {starmallow-0.8.0 → starmallow-0.9.1}/tests/test_delimited_params.py +2 -2
- {starmallow-0.8.0 → starmallow-0.9.1}/tests/test_generics.py +1 -1
- {starmallow-0.8.0 → starmallow-0.9.1}/tests/test_http_endpoints.py +2 -2
- {starmallow-0.8.0 → starmallow-0.9.1}/tests/test_input.py +62 -15
- {starmallow-0.8.0 → starmallow-0.9.1}/tests/test_middleware.py +2 -2
- {starmallow-0.8.0 → starmallow-0.9.1}/tests/test_requests_orjson.py +32 -32
- {starmallow-0.8.0 → starmallow-0.9.1}/tests/test_requests_ujson.py +32 -32
- {starmallow-0.8.0 → starmallow-0.9.1}/tests/test_resolved_param_contextmanagers.py +1 -3
- {starmallow-0.8.0 → starmallow-0.9.1}/tests/test_resolved_params.py +3 -3
- {starmallow-0.8.0 → starmallow-0.9.1}/tests/test_responses.py +8 -8
- {starmallow-0.8.0 → starmallow-0.9.1}/tests/test_responses_orjson.py +8 -8
- {starmallow-0.8.0 → starmallow-0.9.1}/tests/test_responses_ujson.py +8 -8
- starmallow-0.9.1/tests/utils.py +51 -0
- starmallow-0.9.1/uv.lock +1473 -0
- starmallow-0.8.0/starmallow/__init__.py +0 -8
- starmallow-0.8.0/starmallow/middleware/__init__.py +0 -1
- starmallow-0.8.0/starmallow/types.py +0 -20
- starmallow-0.8.0/tests/utils.py +0 -47
- {starmallow-0.8.0 → starmallow-0.9.1}/.gitignore +0 -0
- {starmallow-0.8.0 → starmallow-0.9.1}/Dockerfile +0 -0
- {starmallow-0.8.0 → starmallow-0.9.1}/LICENSE.md +0 -0
- {starmallow-0.8.0 → starmallow-0.9.1}/README.md +0 -0
- {starmallow-0.8.0 → starmallow-0.9.1}/docker-compose.yml +0 -0
- {starmallow-0.8.0 → starmallow-0.9.1}/docs/design_ideas.md +0 -0
- {starmallow-0.8.0 → starmallow-0.9.1}/examples/__init__.py +0 -0
- {starmallow-0.8.0 → starmallow-0.9.1}/examples/cache_server.py +0 -0
- {starmallow-0.8.0 → starmallow-0.9.1}/examples/flask_server.py +0 -0
- {starmallow-0.8.0 → starmallow-0.9.1}/examples/goals.ipynb +0 -0
- {starmallow-0.8.0 → starmallow-0.9.1}/examples/gunicorn.py +0 -0
- {starmallow-0.8.0 → starmallow-0.9.1}/examples/recommended_server.py +0 -0
- {starmallow-0.8.0 → starmallow-0.9.1}/starmallow/constants.py +0 -0
- {starmallow-0.8.0 → starmallow-0.9.1}/starmallow/exception_handlers.py +0 -0
- {starmallow-0.8.0 → starmallow-0.9.1}/starmallow/ext/__init__.py +0 -0
- {starmallow-0.8.0 → starmallow-0.9.1}/starmallow/ext/marshmallow/__init__.py +0 -0
- /starmallow-0.8.0/tests/__init__.py → /starmallow-0.9.1/starmallow/py.typed +0 -0
- {starmallow-0.8.0 → starmallow-0.9.1}/starmallow/requests.py +0 -0
- {starmallow-0.8.0 → starmallow-0.9.1}/starmallow/security/__init__.py +0 -0
- {starmallow-0.8.0/tests/security → starmallow-0.9.1/tests}/__init__.py +0 -0
- {starmallow-0.8.0/tests/security/api_key → starmallow-0.9.1/tests/security}/__init__.py +0 -0
- {starmallow-0.8.0/tests/security/http → starmallow-0.9.1/tests/security/api_key}/__init__.py +0 -0
- {starmallow-0.8.0 → starmallow-0.9.1}/tests/security/api_key/test_api_key_cookie.py +0 -0
- {starmallow-0.8.0 → starmallow-0.9.1}/tests/security/api_key/test_api_key_cookie_description.py +0 -0
- {starmallow-0.8.0 → starmallow-0.9.1}/tests/security/api_key/test_api_key_header.py +0 -0
- {starmallow-0.8.0 → starmallow-0.9.1}/tests/security/api_key/test_api_key_header_description.py +0 -0
- {starmallow-0.8.0 → starmallow-0.9.1}/tests/security/api_key/test_api_key_query.py +0 -0
- {starmallow-0.8.0 → starmallow-0.9.1}/tests/security/api_key/test_api_key_query_description.py +0 -0
- {starmallow-0.8.0/tests/security/oauth2 → starmallow-0.9.1/tests/security/http}/__init__.py +0 -0
- {starmallow-0.8.0 → starmallow-0.9.1}/tests/security/http/test_http_base.py +0 -0
- {starmallow-0.8.0 → starmallow-0.9.1}/tests/security/http/test_http_base_description.py +0 -0
- {starmallow-0.8.0 → starmallow-0.9.1}/tests/security/http/test_http_basic_realm.py +0 -0
- {starmallow-0.8.0 → starmallow-0.9.1}/tests/security/http/test_http_basic_realm_description.py +0 -0
- {starmallow-0.8.0 → starmallow-0.9.1}/tests/security/http/test_http_bearer.py +0 -0
- {starmallow-0.8.0 → starmallow-0.9.1}/tests/security/http/test_http_bearer_description.py +0 -0
- {starmallow-0.8.0 → starmallow-0.9.1}/tests/security/http/test_http_digest.py +0 -0
- {starmallow-0.8.0 → starmallow-0.9.1}/tests/security/http/test_http_digest_description.py +0 -0
- {starmallow-0.8.0/tests/security/openid_connect → starmallow-0.9.1/tests/security/oauth2}/__init__.py +0 -0
- {starmallow-0.8.0 → starmallow-0.9.1}/tests/security/openid_connect/test_openid_connect.py +0 -0
- {starmallow-0.8.0 → starmallow-0.9.1}/tests/security/openid_connect/test_openid_connect_description.py +0 -0
- {starmallow-0.8.0 → starmallow-0.9.1}/tests/test_additional_response_extra.py +0 -0
- {starmallow-0.8.0 → starmallow-0.9.1}/tests/test_additional_responses_bad.py +0 -0
- {starmallow-0.8.0 → starmallow-0.9.1}/tests/test_additional_responses_custom_model_in_callback.py +0 -0
- {starmallow-0.8.0 → starmallow-0.9.1}/tests/test_additional_responses_router.py +0 -0
- {starmallow-0.8.0 → starmallow-0.9.1}/tests/test_ws_router.py +0 -0
@@ -1,42 +1,42 @@
|
|
1
1
|
default_language_version:
|
2
|
-
python: python3.
|
2
|
+
python: python3.10
|
3
3
|
exclude: '^.*.ipynb$'
|
4
|
+
minimum_pre_commit_version: '4'
|
4
5
|
repos:
|
5
6
|
- repo: https://github.com/pre-commit/pre-commit-hooks
|
6
|
-
rev:
|
7
|
+
rev: v5.0.0
|
7
8
|
hooks:
|
8
9
|
- id: check-added-large-files
|
10
|
+
exclude: ^uv.lock
|
9
11
|
- id: check-shebang-scripts-are-executable
|
10
|
-
- id: check-yaml
|
11
12
|
- id: mixed-line-ending
|
12
13
|
- id: end-of-file-fixer
|
13
14
|
- id: trailing-whitespace
|
14
15
|
|
15
16
|
- repo: https://github.com/asottile/pyupgrade
|
16
|
-
rev: v3.
|
17
|
+
rev: v3.19.1
|
17
18
|
hooks:
|
18
19
|
- id: pyupgrade
|
19
20
|
args:
|
20
|
-
- --
|
21
|
-
- --keep-runtime-typing
|
21
|
+
- --py310-plus
|
22
22
|
|
23
23
|
- repo: https://github.com/asottile/add-trailing-comma
|
24
|
-
rev:
|
24
|
+
rev: v3.1.0
|
25
25
|
hooks:
|
26
26
|
- id: add-trailing-comma
|
27
27
|
|
28
|
-
- repo: https://github.com/
|
29
|
-
rev:
|
30
|
-
hooks:
|
31
|
-
- id: isort
|
32
|
-
|
33
|
-
- repo: https://github.com/charliermarsh/ruff-pre-commit
|
34
|
-
rev: v0.0.267
|
28
|
+
- repo: https://github.com/astral-sh/ruff-pre-commit
|
29
|
+
rev: v0.11.6
|
35
30
|
hooks:
|
36
31
|
- id: ruff
|
37
32
|
args:
|
38
33
|
- --fix
|
39
34
|
|
35
|
+
- repo: https://github.com/RobertCraigie/pyright-python
|
36
|
+
rev: v1.1.399
|
37
|
+
hooks:
|
38
|
+
- id: pyright
|
39
|
+
|
40
40
|
ci:
|
41
41
|
autofix_commit_msg: 🎨 [pre-commit.ci] Auto format from pre-commit.com hooks
|
42
42
|
autoupdate_commit_msg: ⬆ [pre-commit.ci] pre-commit autoupdate
|
@@ -0,0 +1 @@
|
|
1
|
+
3.10
|
@@ -1,10 +1,11 @@
|
|
1
|
-
Metadata-Version: 2.
|
1
|
+
Metadata-Version: 2.4
|
2
2
|
Name: starmallow
|
3
|
-
Version: 0.
|
3
|
+
Version: 0.9.1
|
4
4
|
Summary: StarMallow framework
|
5
5
|
Project-URL: Homepage, https://github.com/mvanderlee/starmallow
|
6
6
|
Author-email: Michiel Vanderlee <jmt.vanderlee@gmail.com>
|
7
|
-
License: MIT
|
7
|
+
License-Expression: MIT
|
8
|
+
License-File: LICENSE.md
|
8
9
|
Classifier: Development Status :: 3 - Alpha
|
9
10
|
Classifier: Environment :: Web Environment
|
10
11
|
Classifier: Framework :: AsyncIO
|
@@ -17,6 +18,8 @@ Classifier: Programming Language :: Python
|
|
17
18
|
Classifier: Programming Language :: Python :: 3 :: Only
|
18
19
|
Classifier: Programming Language :: Python :: 3.10
|
19
20
|
Classifier: Programming Language :: Python :: 3.11
|
21
|
+
Classifier: Programming Language :: Python :: 3.12
|
22
|
+
Classifier: Programming Language :: Python :: 3.13
|
20
23
|
Classifier: Topic :: Internet
|
21
24
|
Classifier: Topic :: Internet :: WWW/HTTP
|
22
25
|
Classifier: Topic :: Internet :: WWW/HTTP :: HTTP Servers
|
@@ -29,28 +32,26 @@ Requires-Python: >=3.10
|
|
29
32
|
Requires-Dist: apispec[marshmallow]<7,>=6
|
30
33
|
Requires-Dist: dpath<3,>=2.1.0
|
31
34
|
Requires-Dist: marshmallow-dataclass2<9,>=8.8.1
|
32
|
-
Requires-Dist: marshmallow
|
33
|
-
Requires-Dist: python-multipart
|
35
|
+
Requires-Dist: marshmallow>=3.18.0
|
36
|
+
Requires-Dist: python-multipart>=0.0.20
|
34
37
|
Requires-Dist: pyyaml>=5.4.1
|
35
|
-
Requires-Dist: starlette
|
38
|
+
Requires-Dist: starlette>=0.46
|
36
39
|
Provides-Extra: all
|
37
40
|
Requires-Dist: orjson; extra == 'all'
|
38
41
|
Requires-Dist: ujson>=3.2.1; extra == 'all'
|
39
42
|
Requires-Dist: uvicorn[standard]>=0.12.0; extra == 'all'
|
40
43
|
Provides-Extra: dev
|
41
|
-
Requires-Dist:
|
42
|
-
Requires-Dist:
|
43
|
-
Requires-Dist:
|
44
|
-
Requires-Dist: uvicorn[standard]<0.22.0,>=0.17.0; extra == 'dev'
|
44
|
+
Requires-Dist: pre-commit>=4; extra == 'dev'
|
45
|
+
Requires-Dist: ruff==0.11.6; extra == 'dev'
|
46
|
+
Requires-Dist: uvicorn[standard]>=0.34; extra == 'dev'
|
45
47
|
Provides-Extra: publish
|
46
48
|
Requires-Dist: hatch>=1.7.0; extra == 'publish'
|
47
49
|
Provides-Extra: test
|
48
50
|
Requires-Dist: coverage[toml]<8.0,>=6.5.0; extra == 'test'
|
49
51
|
Requires-Dist: httpx>=0.22.0; extra == 'test'
|
50
|
-
Requires-Dist: isort<6.0.0,>=5.0.6; extra == 'test'
|
51
52
|
Requires-Dist: mypy<2,>=1.1.1; extra == 'test'
|
52
|
-
Requires-Dist: pytest
|
53
|
-
Requires-Dist: ruff==0.
|
53
|
+
Requires-Dist: pytest>=8; extra == 'test'
|
54
|
+
Requires-Dist: ruff==0.11.6; extra == 'test'
|
54
55
|
Description-Content-Type: text/markdown
|
55
56
|
|
56
57
|
# StarMallow
|
@@ -1,5 +1,6 @@
|
|
1
|
+
import asyncio
|
1
2
|
from dataclasses import asdict
|
2
|
-
from typing import Annotated
|
3
|
+
from typing import Annotated
|
3
4
|
|
4
5
|
import aiofiles.tempfile
|
5
6
|
import marshmallow.fields as mf
|
@@ -8,6 +9,7 @@ from marshmallow.validate import Range
|
|
8
9
|
from marshmallow_dataclass2 import dataclass as ma_dataclass
|
9
10
|
from starlette.middleware import Middleware
|
10
11
|
from starlette.middleware.gzip import GZipMiddleware
|
12
|
+
from starlette.responses import StreamingResponse
|
11
13
|
from starlette_context import middleware, plugins
|
12
14
|
|
13
15
|
from starmallow.applications import StarMallow
|
@@ -70,7 +72,7 @@ async def test(
|
|
70
72
|
my_string: str = Body('foobar'),
|
71
73
|
email: str = Body(..., model=mf.Email()),
|
72
74
|
foobar: str = Header(...),
|
73
|
-
preference:
|
75
|
+
preference: str | None = Cookie(...),
|
74
76
|
) -> CreateResponse:
|
75
77
|
print(create_request)
|
76
78
|
print(limit)
|
@@ -139,3 +141,19 @@ async def put_tmp_file(create_request: CreateRequest) -> CreateResponse:
|
|
139
141
|
await f.write(orjson.dumps(create_request))
|
140
142
|
|
141
143
|
return asdict(create_request)
|
144
|
+
|
145
|
+
|
146
|
+
@app.get('/streaming_response')
|
147
|
+
async def streaming_response():
|
148
|
+
async def stream():
|
149
|
+
yield b'event: notification\n'
|
150
|
+
yield b'data: A long message to try and fill the buffer'
|
151
|
+
yield b'\n\n'
|
152
|
+
|
153
|
+
await asyncio.sleep(2)
|
154
|
+
|
155
|
+
yield b'event: notification\n'
|
156
|
+
yield b'data: all done'
|
157
|
+
yield b'\n\n'
|
158
|
+
|
159
|
+
return StreamingResponse(stream(), media_type="text/event-stream")
|
@@ -31,17 +31,19 @@ classifiers = [
|
|
31
31
|
"Programming Language :: Python :: 3 :: Only",
|
32
32
|
"Programming Language :: Python :: 3.10",
|
33
33
|
"Programming Language :: Python :: 3.11",
|
34
|
+
"Programming Language :: Python :: 3.12",
|
35
|
+
"Programming Language :: Python :: 3.13",
|
34
36
|
"Topic :: Internet :: WWW/HTTP :: HTTP Servers",
|
35
37
|
"Topic :: Internet :: WWW/HTTP",
|
36
38
|
]
|
37
39
|
dependencies = [
|
38
40
|
"apispec[marshmallow] >=6,<7",
|
39
41
|
"dpath >=2.1.0,<3",
|
40
|
-
"marshmallow >=3.18.0
|
42
|
+
"marshmallow >=3.18.0",
|
41
43
|
"marshmallow-dataclass2 >=8.8.1,<9",
|
42
|
-
"python-multipart >=0.0.
|
44
|
+
"python-multipart >=0.0.20",
|
43
45
|
"pyyaml >=5.4.1",
|
44
|
-
"starlette >=0.
|
46
|
+
"starlette >=0.46",
|
45
47
|
]
|
46
48
|
dynamic = ["version"]
|
47
49
|
|
@@ -58,16 +60,14 @@ all = [
|
|
58
60
|
test = [
|
59
61
|
"coverage[toml] >= 6.5.0,< 8.0",
|
60
62
|
"httpx >=0.22.0",
|
61
|
-
"isort >=5.0.6,<6.0.0",
|
62
63
|
"mypy>=1.1.1,<2",
|
63
|
-
"pytest >=
|
64
|
-
"ruff ==0.
|
64
|
+
"pytest >=8",
|
65
|
+
"ruff ==0.11.6",
|
65
66
|
]
|
66
67
|
dev = [
|
67
|
-
"
|
68
|
-
"
|
69
|
-
"
|
70
|
-
"pre-commit >=3.2.0,<4",
|
68
|
+
"ruff ==0.11.6",
|
69
|
+
"uvicorn[standard] >=0.34",
|
70
|
+
"pre-commit >=4",
|
71
71
|
]
|
72
72
|
publish = [
|
73
73
|
"hatch >= 1.7.0",
|
@@ -88,21 +88,63 @@ source = [
|
|
88
88
|
]
|
89
89
|
|
90
90
|
[tool.ruff]
|
91
|
+
exclude = [
|
92
|
+
"*.ipynb",
|
93
|
+
"examples/**/*.py",
|
94
|
+
]
|
91
95
|
select = [
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
96
|
+
"E", # pycodestyle errors
|
97
|
+
"W", # pycodestyle warnings
|
98
|
+
"F", # pyflakes
|
99
|
+
"I", # isort
|
100
|
+
"C", # flake8-comprehensions
|
101
|
+
"B", # flake8-bugbear
|
102
|
+
"A", # flake8-builtins
|
103
|
+
"N", # pep8-naming
|
104
|
+
"UP", # pyupgrade
|
105
|
+
"S", # flake8-bandit
|
106
|
+
"COM", # flake8-commas
|
107
|
+
"ISC", # flake8-implicit-str-concat
|
108
|
+
"INP", # flake8-no-pep420
|
109
|
+
"PIE", # flake8-pie
|
110
|
+
"SIM", # flake8-simplify
|
111
|
+
"RUF", # Ruff-specific rules
|
112
|
+
"T20", # flake8-print
|
113
|
+
"PT", # flake8-pytest-style
|
98
114
|
]
|
99
115
|
ignore = [
|
100
|
-
|
101
|
-
|
102
|
-
|
116
|
+
"B008", # do not perform function calls in argument defaults
|
117
|
+
"B028", # No explicit stacklevel argument found.
|
118
|
+
"C901", # too complex
|
119
|
+
|
120
|
+
"N818", # error-suffix-on-exception-name
|
121
|
+
"S101", # Use assert instead of if
|
103
122
|
]
|
104
123
|
line-length = 130 # Enforce 130. But ~100 is recommended.
|
105
124
|
|
125
|
+
[tool.ruff.lint.pycodestyle]
|
126
|
+
max-line-length = 150 # E501 reports lines that exceed the length of 150.
|
106
127
|
|
107
128
|
[tool.ruff.per-file-ignores]
|
108
129
|
"__init__.py" = ["F401"]
|
130
|
+
"starmallow/security/*.py" = ["N815"]
|
131
|
+
|
132
|
+
[tool.ruff.lint.flake8-bugbear]
|
133
|
+
# Allow default arguments like, e.g., `data: List[str] = fastapi.Query(None)`.
|
134
|
+
extend-immutable-calls = [
|
135
|
+
"starmallow.dataclasses.required_field",
|
136
|
+
"starmallow.dataclasses.optional_field",
|
137
|
+
"starmallow.dataclasses.dump_only_field",
|
138
|
+
]
|
139
|
+
|
140
|
+
[tool.pyright]
|
141
|
+
venvPath = "."
|
142
|
+
venv = ".venv"
|
143
|
+
|
144
|
+
exclude = [
|
145
|
+
"examples/**/*.py",
|
146
|
+
"tests/**/*.py",
|
147
|
+
]
|
148
|
+
|
149
|
+
pythonVersion = "3.10"
|
150
|
+
reportInvalidTypeForm = false
|
@@ -0,0 +1,17 @@
|
|
1
|
+
__version__ = "0.9.1"
|
2
|
+
|
3
|
+
from .applications import StarMallow as StarMallow
|
4
|
+
from .exceptions import RequestValidationError as RequestValidationError
|
5
|
+
from .params import Body as Body
|
6
|
+
from .params import Cookie as Cookie
|
7
|
+
from .params import Form as Form
|
8
|
+
from .params import Header as Header
|
9
|
+
from .params import NoParam as NoParam
|
10
|
+
from .params import Path as Path
|
11
|
+
from .params import Query as Query
|
12
|
+
from .params import ResolvedParam as ResolvedParam
|
13
|
+
from .params import Security as Security
|
14
|
+
from .responses import HTTPValidationError as HTTPValidationError
|
15
|
+
from .routing import APIRoute as APIRoute
|
16
|
+
from .routing import APIRouter as APIRouter
|
17
|
+
from .websockets import APIWebSocket as APIWebSocket
|