starmallow 0.9.1__py3-none-any.whl → 0.9.3__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 CHANGED
@@ -1,4 +1,4 @@
1
- __version__ = "0.9.1"
1
+ __version__ = "0.9.3"
2
2
 
3
3
  from .applications import StarMallow as StarMallow
4
4
  from .exceptions import RequestValidationError as RequestValidationError
@@ -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 sys
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
@@ -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.update(kwargs['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/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.1
3
+ Version: 0.9.3
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,11 +27,11 @@ 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.10
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
35
- Requires-Dist: marshmallow>=3.18.0
34
+ Requires-Dist: marshmallow<4,>=3.18.0
36
35
  Requires-Dist: python-multipart>=0.0.20
37
36
  Requires-Dist: pyyaml>=5.4.1
38
37
  Requires-Dist: starlette>=0.46
@@ -1,4 +1,4 @@
1
- starmallow/__init__.py,sha256=KdL5v_AucJIjcuf2DlTvRPZKr6nqyyrpMORXs3FyKCg,691
1
+ starmallow/__init__.py,sha256=z8tCpeWZjKuzfuwS1gCfyEudJnQqy264MF9H8BRSzjE,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=MKQnCp-B8q1R69G6aCgthtWVCISqkKBFpTSnwcfC_8A,4429
9
+ starmallow/delimited_field.py,sha256=4a6ObLK4LBxayd6o5bh5i9bR2K0miOkFFdj8r2km-g8,4286
10
10
  starmallow/docs.py,sha256=tc077aDFAzHTjpnEpqS8BVMhVolaYFmrqQ2obd1Jsbg,6229
11
- starmallow/endpoint.py,sha256=JVJTglAkAydVKIsgKr4dR_X9gzso6OHr_d6xUhq1MNU,17794
11
+ starmallow/endpoint.py,sha256=tMenPecy9pwUj_KlJn7rPvPqWmgEHyGWg6AGfn3Pn9E,17857
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
@@ -23,11 +23,11 @@ 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=CudZ2x7iWHr6xi7RT848aSIZuAfDUFzWVCxHuyKvk-E,14146
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=SkaGp80qvQxDSatxygN3IIKXQ7GTa01rioY_uddTxEs,10164
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.1.dist-info/METADATA,sha256=fwkeplNEumkhIOM88v_4oWy5Lb0v1x3D2vicIk1VwhU,5611
41
- starmallow-0.9.1.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
42
- starmallow-0.9.1.dist-info/licenses/LICENSE.md,sha256=QelyGgOzch8CXzy6HrYwHh7nmj0rlWkDA0YzmZ3CPaY,1084
43
- starmallow-0.9.1.dist-info/RECORD,,
40
+ starmallow-0.9.3.dist-info/METADATA,sha256=znGdx3U9ClPvd3wBplGXyaI_5rcUkCCPD3IbTuG5ixY,5563
41
+ starmallow-0.9.3.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
42
+ starmallow-0.9.3.dist-info/licenses/LICENSE.md,sha256=QelyGgOzch8CXzy6HrYwHh7nmj0rlWkDA0YzmZ3CPaY,1084
43
+ starmallow-0.9.3.dist-info/RECORD,,