starmallow 0.9.1__py3-none-any.whl → 0.9.2__py3-none-any.whl
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/__init__.py +1 -1
- starmallow/delimited_field.py +3 -10
- starmallow/endpoint.py +9 -6
- starmallow/ext/marshmallow/openapi.py +1 -1
- starmallow/request_resolver.py +1 -1
- starmallow/utils.py +1 -7
- {starmallow-0.9.1.dist-info → starmallow-0.9.2.dist-info}/METADATA +2 -3
- {starmallow-0.9.1.dist-info → starmallow-0.9.2.dist-info}/RECORD +10 -10
- {starmallow-0.9.1.dist-info → starmallow-0.9.2.dist-info}/WHEEL +0 -0
- {starmallow-0.9.1.dist-info → starmallow-0.9.2.dist-info}/licenses/LICENSE.md +0 -0
starmallow/__init__.py
CHANGED
starmallow/delimited_field.py
CHANGED
@@ -15,17 +15,10 @@ tells webargs where to parse the request argument from.
|
|
15
15
|
"content_type": fields.Str(data_key="Content-Type", location="headers"),
|
16
16
|
}
|
17
17
|
"""
|
18
|
-
import
|
19
|
-
from typing import Any, ClassVar, Generic, Protocol, TypeVar
|
18
|
+
from typing import Any, ClassVar, Generic, Protocol, TypeVar, TypeVarTuple
|
20
19
|
|
21
20
|
import marshmallow as ma
|
22
21
|
|
23
|
-
if sys.version_info >= (3, 11):
|
24
|
-
from typing import TypeVarTuple
|
25
|
-
else:
|
26
|
-
# Python 3.10 and below
|
27
|
-
from typing_extensions import TypeVarTuple
|
28
|
-
|
29
22
|
from .generics import get_orig_class
|
30
23
|
|
31
24
|
T = TypeVar('T', bound=ma.fields.Field | type[ma.fields.Field])
|
@@ -73,7 +66,7 @@ class DelimitedFieldMixin:
|
|
73
66
|
if not isinstance(value, str):
|
74
67
|
raise self.make_error("invalid")
|
75
68
|
|
76
|
-
values = value.split(self.delimiter) if value else []
|
69
|
+
values = value.split(self.delimiter) # if value else []
|
77
70
|
return super()._deserialize(values, attr, data, **kwargs)
|
78
71
|
|
79
72
|
|
@@ -101,7 +94,7 @@ class DelimitedList(DelimitedFieldMixin, ma.fields.List, Generic[T]): # type: i
|
|
101
94
|
super().__init__(cls_or_instance, **kwargs)
|
102
95
|
|
103
96
|
|
104
|
-
class DelimitedTuple(DelimitedFieldMixin, ma.fields.Tuple, Generic[Ts]): # type: ignore
|
97
|
+
class DelimitedTuple(DelimitedFieldMixin, ma.fields.Tuple, Generic[*Ts]): # type: ignore
|
105
98
|
"""A field which is similar to a Tuple, but takes its input as a delimited
|
106
99
|
string (e.g. "foo,bar,baz").
|
107
100
|
|
starmallow/endpoint.py
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
import inspect
|
2
2
|
import logging
|
3
|
-
from collections.abc import Callable,
|
3
|
+
from collections.abc import Callable, Mapping, Sequence
|
4
4
|
from dataclasses import dataclass, field
|
5
5
|
from typing import (
|
6
6
|
TYPE_CHECKING,
|
@@ -15,8 +15,8 @@ from typing import (
|
|
15
15
|
import marshmallow as ma
|
16
16
|
import marshmallow.fields as mf
|
17
17
|
import typing_inspect
|
18
|
-
from marshmallow.
|
19
|
-
from marshmallow.
|
18
|
+
from marshmallow.constants import missing as missing_
|
19
|
+
from marshmallow.types import StrSequenceOrSet, UnknownOption
|
20
20
|
from marshmallow_dataclass2 import class_schema, is_generic_alias_of_dataclass
|
21
21
|
from starlette.background import BackgroundTasks
|
22
22
|
from starlette.requests import HTTPConnection, Request
|
@@ -159,11 +159,11 @@ class SchemaModel(ma.Schema):
|
|
159
159
|
|
160
160
|
def load(
|
161
161
|
self,
|
162
|
-
data: Mapping[str, Any] |
|
162
|
+
data: Mapping[str, Any] | Sequence[Mapping[str, Any]],
|
163
163
|
*,
|
164
164
|
many: bool | None = None,
|
165
165
|
partial: bool | StrSequenceOrSet | None = None,
|
166
|
-
unknown:
|
166
|
+
unknown: UnknownOption | None = None,
|
167
167
|
) -> Any:
|
168
168
|
if not data and self.load_default:
|
169
169
|
return self.load_default
|
@@ -258,7 +258,10 @@ class EndpointMixin:
|
|
258
258
|
|
259
259
|
model.required = kwargs['required']
|
260
260
|
model.load_default = kwargs.get('load_default', ma.missing)
|
261
|
-
model.metadata
|
261
|
+
model.metadata = {
|
262
|
+
**model.metadata,
|
263
|
+
**kwargs['metadata'],
|
264
|
+
}
|
262
265
|
|
263
266
|
return model
|
264
267
|
|
@@ -203,7 +203,7 @@ class OpenAPIConverter(ApiSpecOpenAPIConverter):
|
|
203
203
|
ret = {}
|
204
204
|
|
205
205
|
if isinstance(field, mf.Enum):
|
206
|
-
choices = [x.value for x in field.enum] if field.by_value else list(field.enum.__members__)
|
206
|
+
choices = [x.value for x in field.enum] if field.by_value else list(field.enum.__members__) # type: ignore
|
207
207
|
|
208
208
|
if choices:
|
209
209
|
ret['enum'] = choices
|
starmallow/request_resolver.py
CHANGED
@@ -7,9 +7,9 @@ from typing import Any, cast
|
|
7
7
|
|
8
8
|
import marshmallow as ma
|
9
9
|
import marshmallow.fields as mf
|
10
|
+
from marshmallow.constants import missing as missing_
|
10
11
|
from marshmallow.error_store import ErrorStore
|
11
12
|
from marshmallow.exceptions import SCHEMA
|
12
|
-
from marshmallow.utils import missing as missing_
|
13
13
|
from starlette.background import BackgroundTasks as StarletteBackgroundTasks
|
14
14
|
from starlette.datastructures import FormData, Headers, QueryParams
|
15
15
|
from starlette.exceptions import HTTPException
|
starmallow/utils.py
CHANGED
@@ -3,7 +3,6 @@ import datetime as dt
|
|
3
3
|
import inspect
|
4
4
|
import logging
|
5
5
|
import re
|
6
|
-
import sys
|
7
6
|
import uuid
|
8
7
|
import warnings
|
9
8
|
from collections.abc import Callable, Mapping, Sequence
|
@@ -16,6 +15,7 @@ from typing import (
|
|
16
15
|
TYPE_CHECKING,
|
17
16
|
Any,
|
18
17
|
ForwardRef,
|
18
|
+
NotRequired,
|
19
19
|
Protocol,
|
20
20
|
TypeGuard,
|
21
21
|
TypeVar,
|
@@ -39,12 +39,6 @@ from typing_inspect import is_final_type, is_generic_type, is_literal_type
|
|
39
39
|
from starmallow.concurrency import contextmanager_in_threadpool
|
40
40
|
from starmallow.datastructures import DefaultPlaceholder, DefaultType
|
41
41
|
|
42
|
-
if sys.version_info >= (3, 11):
|
43
|
-
from typing import NotRequired
|
44
|
-
else:
|
45
|
-
# Python 3.10 and below
|
46
|
-
from typing_extensions import NotRequired
|
47
|
-
|
48
42
|
if TYPE_CHECKING: # pragma: nocover
|
49
43
|
from starmallow.routing import APIRoute
|
50
44
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: starmallow
|
3
|
-
Version: 0.9.
|
3
|
+
Version: 0.9.2
|
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>
|
@@ -16,7 +16,6 @@ Classifier: License :: OSI Approved :: MIT License
|
|
16
16
|
Classifier: Operating System :: OS Independent
|
17
17
|
Classifier: Programming Language :: Python
|
18
18
|
Classifier: Programming Language :: Python :: 3 :: Only
|
19
|
-
Classifier: Programming Language :: Python :: 3.10
|
20
19
|
Classifier: Programming Language :: Python :: 3.11
|
21
20
|
Classifier: Programming Language :: Python :: 3.12
|
22
21
|
Classifier: Programming Language :: Python :: 3.13
|
@@ -28,7 +27,7 @@ Classifier: Topic :: Software Development :: Libraries
|
|
28
27
|
Classifier: Topic :: Software Development :: Libraries :: Application Frameworks
|
29
28
|
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
30
29
|
Classifier: Typing :: Typed
|
31
|
-
Requires-Python: >=3.
|
30
|
+
Requires-Python: >=3.11
|
32
31
|
Requires-Dist: apispec[marshmallow]<7,>=6
|
33
32
|
Requires-Dist: dpath<3,>=2.1.0
|
34
33
|
Requires-Dist: marshmallow-dataclass2<9,>=8.8.1
|
@@ -1,4 +1,4 @@
|
|
1
|
-
starmallow/__init__.py,sha256=
|
1
|
+
starmallow/__init__.py,sha256=cnJ0uuTI6vSNBSC11DOBlViasfQ1ibVWYiB7u8m5GBE,691
|
2
2
|
starmallow/applications.py,sha256=wI3mViPAgMAGDUy0PzDLyd6GFQaFY_d1-85LBASATNY,30396
|
3
3
|
starmallow/background.py,sha256=asjTMgO25zqZiKsxcEVBGPKd_Nb7RVZDEmzR4PNy6-k,996
|
4
4
|
starmallow/concurrency.py,sha256=YNIFo8jmHZYXfFkqzL1xFiE5QFwWYnGUsYgAROv041Q,1404
|
@@ -6,9 +6,9 @@ starmallow/constants.py,sha256=u0h8cJKhJY0oIZqzr7wpEZG2bPLrw5FroMnn3d8KBNQ,129
|
|
6
6
|
starmallow/dataclasses.py,sha256=P8Eft25Q5UBhDp-3b0T-n2IOtjrQpxmRUxs3WAwlRFQ,2787
|
7
7
|
starmallow/datastructures.py,sha256=oq2Dz6zcoQx9ctMSSviZMAX_wvNTT9ytkSBtZjcg7bY,853
|
8
8
|
starmallow/decorators.py,sha256=VGzfFYualOcplRK6L3Tu2GrCl3a5yrOgADqWMokqzcQ,4036
|
9
|
-
starmallow/delimited_field.py,sha256=
|
9
|
+
starmallow/delimited_field.py,sha256=4a6ObLK4LBxayd6o5bh5i9bR2K0miOkFFdj8r2km-g8,4286
|
10
10
|
starmallow/docs.py,sha256=tc077aDFAzHTjpnEpqS8BVMhVolaYFmrqQ2obd1Jsbg,6229
|
11
|
-
starmallow/endpoint.py,sha256=
|
11
|
+
starmallow/endpoint.py,sha256=MtABY6fC_R009leoDyRHkxeSAK7bQ4xMsvYPh3vYKdE,17876
|
12
12
|
starmallow/endpoints.py,sha256=2RuKhEX0EpEyWUdlKVfD0WXz_8zNQEduCoZ4UJkybZc,953
|
13
13
|
starmallow/exception_handlers.py,sha256=gr2qLYWEtsIEH28n7OreEiiLVz6Y7b6osRyS9esJbBk,891
|
14
14
|
starmallow/exceptions.py,sha256=arXkENa6dV626t_IDWZKqrh6laeV54PWbVIW0dafT2o,843
|
@@ -16,18 +16,18 @@ starmallow/fields.py,sha256=5zXP2JLyTpVnVhl23GYHY9W3Sc5Oc_kRvOWmI7WWNRM,1283
|
|
16
16
|
starmallow/generics.py,sha256=CE_Wf0vIqkup0mirGa-PL5511DT-avaCkC1Jx4sMe_U,1102
|
17
17
|
starmallow/params.py,sha256=EDnUNVNfRY7uv5D1rzfmIrWKJ85R2ku4l13w1QKG4E8,8720
|
18
18
|
starmallow/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
19
|
-
starmallow/request_resolver.py,sha256=
|
19
|
+
starmallow/request_resolver.py,sha256=RYMtCgvEkwyWTF2N33mq-HEeAHysXegaHnEvV-sYuBw,11693
|
20
20
|
starmallow/requests.py,sha256=o_yNhH9WJ35uAGuoXa5_gihevHeaveOvkP525dbwQSU,843
|
21
21
|
starmallow/responses.py,sha256=H6Ze0R5JG9O8eaS4dffiAn3lI6Y9-hz3aDHdWKGk_nw,2023
|
22
22
|
starmallow/routing.py,sha256=dK6ayN_Ruqz3ZGNQ3pFwqnguF7Vl0oIfD7e8OnnED_Y,45364
|
23
23
|
starmallow/schema_generator.py,sha256=Y4o8v5OUgTZA2byTOcUKONimdF8JjiwD8FZLxCVOF0I,19210
|
24
24
|
starmallow/serializers.py,sha256=Z-42L6is9klknpJ3r1DcGjB7t_txPfRvp-Rvj87_n70,12622
|
25
25
|
starmallow/types.py,sha256=zcdq5iIHOVVe-KINzSRNuE0xFMBSA7KefUp-HPRdZEw,840
|
26
|
-
starmallow/utils.py,sha256=
|
26
|
+
starmallow/utils.py,sha256=zPio5mf4dWQ0U1ComtzLzsAv9T_iBxkz9Cf2pC8O6dY,14004
|
27
27
|
starmallow/websockets.py,sha256=54ctFGgA4A3VFwpUFmlu8aVmHOo4R6x3O_-z5r2BsdI,2232
|
28
28
|
starmallow/ext/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
29
29
|
starmallow/ext/marshmallow/__init__.py,sha256=33jENGdfPq4-CDG0LOmN3KOGW1pXTy7a2oMwy4hrYzM,208
|
30
|
-
starmallow/ext/marshmallow/openapi.py,sha256=
|
30
|
+
starmallow/ext/marshmallow/openapi.py,sha256=qpTDAFZLJug1hyvOG3FHWc0o7cYCDLjmzebw5dJ6zpQ,10179
|
31
31
|
starmallow/middleware/__init__.py,sha256=NwjiXJbSSLxImnQ9t91c-Dy1jPrvHU_--POXIVOyHPw,81
|
32
32
|
starmallow/middleware/asyncexitstack.py,sha256=wxugZgPg5yxuXxZjPm-_PMG7hAfOeo2lRLR07eaSWS8,1160
|
33
33
|
starmallow/security/__init__.py,sha256=1rQFBIGnEbE51XDZSSi9NgPjXLScFq3RoLu4vk0KVYw,191
|
@@ -37,7 +37,7 @@ starmallow/security/http.py,sha256=wSbRomh9IYAi2nJ4ugFrx2JLg-m85DxWVaUMZt5PwIw,6
|
|
37
37
|
starmallow/security/oauth2.py,sha256=G72-wJyvrGyHUbg9hbzf44RBN8zFalZYnHKpRC2I1po,10108
|
38
38
|
starmallow/security/open_id_connect_url.py,sha256=9E-Zwnt-IR3jimOMkvIwnGHTuJMlGmjs7LCf1SGtKT8,1415
|
39
39
|
starmallow/security/utils.py,sha256=7tziAa2Cwa7xhwM_NF4DSY3BHoqVaWgJ21VuV8LvhrY,253
|
40
|
-
starmallow-0.9.
|
41
|
-
starmallow-0.9.
|
42
|
-
starmallow-0.9.
|
43
|
-
starmallow-0.9.
|
40
|
+
starmallow-0.9.2.dist-info/METADATA,sha256=zoEqForKQacmHgXXeECDQ-iBTErzBdYc1gVEfap50jQ,5560
|
41
|
+
starmallow-0.9.2.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
42
|
+
starmallow-0.9.2.dist-info/licenses/LICENSE.md,sha256=QelyGgOzch8CXzy6HrYwHh7nmj0rlWkDA0YzmZ3CPaY,1084
|
43
|
+
starmallow-0.9.2.dist-info/RECORD,,
|
File without changes
|
File without changes
|