cadwyn 3.6.0.dev0__py3-none-any.whl → 3.6.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.
Potentially problematic release.
This version of cadwyn might be problematic. Click here for more details.
- cadwyn/applications.py +3 -7
- cadwyn/exceptions.py +1 -1
- cadwyn/routing.py +1 -3
- cadwyn/structure/versions.py +1 -4
- {cadwyn-3.6.0.dev0.dist-info → cadwyn-3.6.2.dist-info}/METADATA +1 -1
- {cadwyn-3.6.0.dev0.dist-info → cadwyn-3.6.2.dist-info}/RECORD +9 -9
- {cadwyn-3.6.0.dev0.dist-info → cadwyn-3.6.2.dist-info}/LICENSE +0 -0
- {cadwyn-3.6.0.dev0.dist-info → cadwyn-3.6.2.dist-info}/WHEEL +0 -0
- {cadwyn-3.6.0.dev0.dist-info → cadwyn-3.6.2.dist-info}/entry_points.txt +0 -0
cadwyn/applications.py
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
from collections.abc import Callable, Coroutine, Sequence
|
|
2
2
|
from types import ModuleType
|
|
3
|
-
from typing import Any
|
|
3
|
+
from typing import TYPE_CHECKING, Any, cast
|
|
4
4
|
|
|
5
5
|
from fastapi import APIRouter, routing
|
|
6
6
|
from fastapi.datastructures import Default
|
|
@@ -62,15 +62,11 @@ class Cadwyn(HeaderRoutingFastAPI):
|
|
|
62
62
|
separate_input_output_schemas: bool = True,
|
|
63
63
|
**extra: Any,
|
|
64
64
|
) -> None:
|
|
65
|
-
# TODO: Remove argument entirely in any major version.
|
|
66
65
|
self.versions = versions
|
|
66
|
+
# TODO: Remove argument entirely in any major version.
|
|
67
67
|
latest_schemas_package = extra.pop("latest_schemas_package", None) or self.versions.latest_schemas_package
|
|
68
|
-
if latest_schemas_package is None:
|
|
69
|
-
raise CadwynError(
|
|
70
|
-
"VersionBundle.latest_schemas_package is None but is required for Cadwyn's correct functioning."
|
|
71
|
-
)
|
|
72
|
-
self.latest_schemas_package: ModuleType = latest_schemas_package
|
|
73
68
|
self.versions.latest_schemas_package = latest_schemas_package
|
|
69
|
+
self.latest_schemas_package = cast(ModuleType, latest_schemas_package)
|
|
74
70
|
|
|
75
71
|
super().__init__(
|
|
76
72
|
api_version_header_name=api_version_header_name,
|
cadwyn/exceptions.py
CHANGED
|
@@ -15,7 +15,7 @@ class CadwynLatestRequestValidationError(CadwynError):
|
|
|
15
15
|
self.body = body
|
|
16
16
|
self.version = version
|
|
17
17
|
super().__init__(
|
|
18
|
-
f"We failed to migrate the request with version={
|
|
18
|
+
f"We failed to migrate the request with version={self.version!s}. "
|
|
19
19
|
"This means that there is some error in your migrations or schema structure that makes it impossible "
|
|
20
20
|
"to migrate the request of that version to latest.\n"
|
|
21
21
|
f"body={self.body}\n\nerrors={json.dumps(self.errors, indent=4, ensure_ascii=False)}"
|
cadwyn/routing.py
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import functools
|
|
2
2
|
import inspect
|
|
3
3
|
import re
|
|
4
|
-
import sys
|
|
5
4
|
import typing
|
|
6
5
|
import warnings
|
|
7
6
|
from collections import defaultdict
|
|
@@ -44,11 +43,10 @@ from starlette.routing import (
|
|
|
44
43
|
from typing_extensions import Self, assert_never
|
|
45
44
|
|
|
46
45
|
from cadwyn._compat import model_fields, rebuild_fastapi_body_param
|
|
47
|
-
from cadwyn._package_utils import
|
|
46
|
+
from cadwyn._package_utils import get_version_dir_path
|
|
48
47
|
from cadwyn._utils import Sentinel, UnionType, get_another_version_of_cls
|
|
49
48
|
from cadwyn.exceptions import (
|
|
50
49
|
CadwynError,
|
|
51
|
-
ModuleIsNotVersionedError,
|
|
52
50
|
RouteAlreadyExistsError,
|
|
53
51
|
RouterGenerationError,
|
|
54
52
|
RouterPathParamsModifiedError,
|
cadwyn/structure/versions.py
CHANGED
|
@@ -340,10 +340,7 @@ class VersionBundle:
|
|
|
340
340
|
for defined_version in self.version_dates:
|
|
341
341
|
if defined_version <= version:
|
|
342
342
|
return defined_version
|
|
343
|
-
|
|
344
|
-
raise CadwynError(
|
|
345
|
-
"You tried to migrate to version that is earlier than the first version which is prohibited."
|
|
346
|
-
)
|
|
343
|
+
raise CadwynError("You tried to migrate to version that is earlier than the first version which is prohibited.")
|
|
347
344
|
|
|
348
345
|
@functools.cached_property
|
|
349
346
|
def _version_changes_to_version_mapping(
|
|
@@ -4,7 +4,7 @@ cadwyn/_asts.py,sha256=jFdnbkDDu_10YhJemDUVMut_XoqwIvGMtCQpDeitCiM,10206
|
|
|
4
4
|
cadwyn/_compat.py,sha256=6QwtzbXn53mIhEFfEizmFjd-f894oLsM6ITxqq2rCpc,5408
|
|
5
5
|
cadwyn/_package_utils.py,sha256=trxTYLmppv-10SKhScfyDQJh21rsQGFoLaOtHycKKR0,1443
|
|
6
6
|
cadwyn/_utils.py,sha256=nBBE9PGo9MuHlCgbX8JPz9XcQxF7zIbVtKaBEsgfhGc,4861
|
|
7
|
-
cadwyn/applications.py,sha256
|
|
7
|
+
cadwyn/applications.py,sha256=5i7Fj9Ij1aUyKOjYRWQ1l11KFHGxiOcoTMSp4GzwpTA,5185
|
|
8
8
|
cadwyn/codegen/README.md,sha256=V2Kz2IOz1cTxrC-RnQ7YbWEVCIGYr3tR4IPCvepeq0M,1047
|
|
9
9
|
cadwyn/codegen/__init__.py,sha256=JgddDjxMTjSfVrMXHwNu1ODgdn2QfPWpccrRKquBV6k,355
|
|
10
10
|
cadwyn/codegen/_common.py,sha256=j-K0zMINmOKPhwsKjtfmrUrNzgEU4gM2EEFC7wvpCdU,5696
|
|
@@ -16,10 +16,10 @@ cadwyn/codegen/_plugins/class_renaming.py,sha256=5ka2W1c18i4maNbEkEpELvGLEFbd8tt
|
|
|
16
16
|
cadwyn/codegen/_plugins/import_auto_adding.py,sha256=00zGK99cT-bq2eXKDlYBR5-Z3uHLOGU7dbhB0YFFrt0,2613
|
|
17
17
|
cadwyn/codegen/_plugins/latest_version_aliasing.py,sha256=9MPW-FMOcjBZ7L05T0sxwSDCfFZHAn6xZV_E1KImbUA,3946
|
|
18
18
|
cadwyn/codegen/_plugins/module_migrations.py,sha256=TeWJk4Iu4SRQ9K2iI3v3sCs1110jrltKlPdfU9mXIsQ,722
|
|
19
|
-
cadwyn/exceptions.py,sha256=
|
|
19
|
+
cadwyn/exceptions.py,sha256=JUHFjxWl2XlnweVnSpq3mWFUNU0ocyXBBleMMQyCyBk,1442
|
|
20
20
|
cadwyn/main.py,sha256=kt2Vn7TIA4ZnD_xrgz57TOjUk-4zVP8SV8nuTZBEaaU,218
|
|
21
21
|
cadwyn/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
22
|
-
cadwyn/routing.py,sha256=
|
|
22
|
+
cadwyn/routing.py,sha256=njVzrVOruO-WFI74f3JIfATivSiz1C5EJuWjjZyaseI,34937
|
|
23
23
|
cadwyn/structure/__init__.py,sha256=BjFPlQYCw8ds_4zxdCi2LimarUGqSzyTNmOdT-FkGms,661
|
|
24
24
|
cadwyn/structure/common.py,sha256=6Z4nI97XPWTCinn6np73m-rLPyYNrz2fWXKJlqjsiaQ,269
|
|
25
25
|
cadwyn/structure/data.py,sha256=u5-pJ48BRnPSt2JbH6AefHGddTEE5z7YBnyv0iGw3dQ,6133
|
|
@@ -27,9 +27,9 @@ cadwyn/structure/endpoints.py,sha256=VngfAydGBwekhV2tBOtNDPVgl3X1IgYxUCw--VZ5cQY
|
|
|
27
27
|
cadwyn/structure/enums.py,sha256=iMokxA2QYJ61SzyB-Pmuq3y7KL7-e6TsnjLVUaVZQnw,954
|
|
28
28
|
cadwyn/structure/modules.py,sha256=1FK-lLm-zOTXEvn-QtyBH38aDRht5PDQiZrOPCsBlM4,1268
|
|
29
29
|
cadwyn/structure/schemas.py,sha256=5hExJEdvEFPK4Cv8G_Gh6E6ltiNMyId_UjGIJz3jz0o,8802
|
|
30
|
-
cadwyn/structure/versions.py,sha256=
|
|
31
|
-
cadwyn-3.6.
|
|
32
|
-
cadwyn-3.6.
|
|
33
|
-
cadwyn-3.6.
|
|
34
|
-
cadwyn-3.6.
|
|
35
|
-
cadwyn-3.6.
|
|
30
|
+
cadwyn/structure/versions.py,sha256=6M_saZPlzEQ0LNRQywhtrw-YPdjT0P18EEPTRg1dR8Y,32785
|
|
31
|
+
cadwyn-3.6.2.dist-info/LICENSE,sha256=KeCWewiDQYpmSnzF-p_0YpoWiyDcUPaCuG8OWQs4ig4,1072
|
|
32
|
+
cadwyn-3.6.2.dist-info/METADATA,sha256=4Df3NBeSBNBXWHrvfu-CV7joegK1ayPli85u7n-_Pso,4115
|
|
33
|
+
cadwyn-3.6.2.dist-info/WHEEL,sha256=FMvqSimYX_P7y0a7UY-_Mc83r5zkBZsCYPm7Lr0Bsq4,88
|
|
34
|
+
cadwyn-3.6.2.dist-info/entry_points.txt,sha256=eO05hLn9GoRzzpwT9GONPmXKsonjuMNssM2D2WHWKGk,46
|
|
35
|
+
cadwyn-3.6.2.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|