cadwyn 5.1.3__py3-none-any.whl → 5.2.0__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/_render.py +1 -1
- cadwyn/route_generation.py +1 -2
- cadwyn/structure/schemas.py +1 -1
- cadwyn/structure/versions.py +8 -6
- {cadwyn-5.1.3.dist-info → cadwyn-5.2.0.dist-info}/METADATA +1 -2
- {cadwyn-5.1.3.dist-info → cadwyn-5.2.0.dist-info}/RECORD +9 -9
- {cadwyn-5.1.3.dist-info → cadwyn-5.2.0.dist-info}/WHEEL +0 -0
- {cadwyn-5.1.3.dist-info → cadwyn-5.2.0.dist-info}/entry_points.txt +0 -0
- {cadwyn-5.1.3.dist-info → cadwyn-5.2.0.dist-info}/licenses/LICENSE +0 -0
cadwyn/_render.py
CHANGED
|
@@ -5,10 +5,10 @@ from enum import Enum
|
|
|
5
5
|
from typing import TYPE_CHECKING, Union
|
|
6
6
|
|
|
7
7
|
import typer
|
|
8
|
-
from issubclass import issubclass as lenient_issubclass
|
|
9
8
|
from pydantic import BaseModel
|
|
10
9
|
|
|
11
10
|
from cadwyn._asts import get_fancy_repr, pop_docstring_from_cls_body
|
|
11
|
+
from cadwyn._utils import lenient_issubclass
|
|
12
12
|
from cadwyn.exceptions import CadwynRenderError
|
|
13
13
|
from cadwyn.schema_generation import (
|
|
14
14
|
PydanticFieldWrapper,
|
cadwyn/route_generation.py
CHANGED
|
@@ -17,12 +17,11 @@ import fastapi.security.base
|
|
|
17
17
|
import fastapi.utils
|
|
18
18
|
from fastapi import APIRouter
|
|
19
19
|
from fastapi.routing import APIRoute
|
|
20
|
-
from issubclass import issubclass as lenient_issubclass
|
|
21
20
|
from pydantic import BaseModel
|
|
22
21
|
from starlette.routing import BaseRoute
|
|
23
22
|
from typing_extensions import TypeVar, assert_never
|
|
24
23
|
|
|
25
|
-
from cadwyn._utils import DATACLASS_SLOTS, Sentinel
|
|
24
|
+
from cadwyn._utils import DATACLASS_SLOTS, Sentinel, lenient_issubclass
|
|
26
25
|
from cadwyn.exceptions import (
|
|
27
26
|
CadwynError,
|
|
28
27
|
RouteAlreadyExistsError,
|
cadwyn/structure/schemas.py
CHANGED
|
@@ -2,7 +2,6 @@ from collections.abc import Callable
|
|
|
2
2
|
from dataclasses import dataclass
|
|
3
3
|
from typing import TYPE_CHECKING, Any, Literal, Union, cast
|
|
4
4
|
|
|
5
|
-
from issubclass import issubclass as lenient_issubclass
|
|
6
5
|
from pydantic import AliasChoices, AliasPath, BaseModel, Field
|
|
7
6
|
from pydantic._internal._decorators import PydanticDescriptorProxy, unwrap_wrapped_function
|
|
8
7
|
from pydantic.fields import FieldInfo
|
|
@@ -12,6 +11,7 @@ from cadwyn._utils import (
|
|
|
12
11
|
Sentinel,
|
|
13
12
|
fully_unwrap_decorator,
|
|
14
13
|
get_name_of_function_wrapped_in_pydantic_validator,
|
|
14
|
+
lenient_issubclass,
|
|
15
15
|
)
|
|
16
16
|
from cadwyn.exceptions import CadwynStructureError
|
|
17
17
|
|
cadwyn/structure/versions.py
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import email.message
|
|
2
2
|
import functools
|
|
3
|
+
import http
|
|
3
4
|
import inspect
|
|
4
5
|
import json
|
|
5
6
|
from collections import defaultdict
|
|
@@ -8,7 +9,7 @@ from contextlib import AsyncExitStack
|
|
|
8
9
|
from contextvars import ContextVar
|
|
9
10
|
from datetime import date
|
|
10
11
|
from enum import Enum
|
|
11
|
-
from typing import TYPE_CHECKING, ClassVar, Union
|
|
12
|
+
from typing import TYPE_CHECKING, ClassVar, Union, cast
|
|
12
13
|
|
|
13
14
|
from fastapi import BackgroundTasks, HTTPException, params
|
|
14
15
|
from fastapi import Request as FastapiRequest
|
|
@@ -616,12 +617,13 @@ class VersionBundle:
|
|
|
616
617
|
detail = response_info.body["detail"]
|
|
617
618
|
else:
|
|
618
619
|
detail = response_info.body
|
|
620
|
+
if detail is None:
|
|
621
|
+
detail = http.HTTPStatus(response_info.status_code).phrase
|
|
622
|
+
raised_exception.detail = cast(str, detail)
|
|
623
|
+
raised_exception.headers = dict(response_info.headers)
|
|
624
|
+
raised_exception.status_code = response_info.status_code
|
|
619
625
|
|
|
620
|
-
raise
|
|
621
|
-
status_code=response_info.status_code,
|
|
622
|
-
detail=detail,
|
|
623
|
-
headers=dict(response_info.headers),
|
|
624
|
-
)
|
|
626
|
+
raise raised_exception
|
|
625
627
|
return response_info._response
|
|
626
628
|
return response_info.body
|
|
627
629
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: cadwyn
|
|
3
|
-
Version: 5.
|
|
3
|
+
Version: 5.2.0
|
|
4
4
|
Summary: Production-ready community-driven modern Stripe-like API versioning in FastAPI
|
|
5
5
|
Project-URL: Source code, https://github.com/zmievsa/cadwyn
|
|
6
6
|
Project-URL: Documentation, https://docs.cadwyn.dev
|
|
@@ -36,7 +36,6 @@ Classifier: Typing :: Typed
|
|
|
36
36
|
Requires-Python: >=3.9
|
|
37
37
|
Requires-Dist: backports-strenum<2,>=1.3.1; python_version < '3.11'
|
|
38
38
|
Requires-Dist: fastapi>=0.112.4
|
|
39
|
-
Requires-Dist: issubclass>=0.1.2
|
|
40
39
|
Requires-Dist: jinja2>=3.1.2
|
|
41
40
|
Requires-Dist: pydantic>=2.0.0
|
|
42
41
|
Requires-Dist: starlette>=0.30.0
|
|
@@ -2,7 +2,7 @@ cadwyn/__init__.py,sha256=uXmQDTDNA5BeRlLFn0cmIo6ohXvEApg2FSl2sFb8frw,1120
|
|
|
2
2
|
cadwyn/__main__.py,sha256=fGoKJPNVueqqXW4rqwmRUBBMoDGeLEyATdT-rel5Pvs,2449
|
|
3
3
|
cadwyn/_asts.py,sha256=QvqZmDdwH8U-Ocpj9vYR6MRrIANF8ugk9oZgAo76qLs,5223
|
|
4
4
|
cadwyn/_importer.py,sha256=QV6HqODCG9K2oL4Vc15fAqL2-plMvUWw_cgaj4Ln4C8,1075
|
|
5
|
-
cadwyn/_render.py,sha256=
|
|
5
|
+
cadwyn/_render.py,sha256=VAY2Twd_MfKaC8_X22AMIQd72_UHy87icdAbKL8hd90,5526
|
|
6
6
|
cadwyn/_utils.py,sha256=q_mTtMKTNTDzqCza67XST-jaPSfuTgnFLmOe0dlGeYY,2295
|
|
7
7
|
cadwyn/applications.py,sha256=YyESoMwQMq9jxqai6lNrsL0BAKxjTKW5lm3Se_U81j4,20391
|
|
8
8
|
cadwyn/changelogs.py,sha256=aBTlsZ8PQpw9t4sSyezNTYDs6CMPtzIGulgAHA1ELPs,19622
|
|
@@ -10,7 +10,7 @@ cadwyn/dependencies.py,sha256=9JihGg7MPbP0oBFRWebvIzhh6B-oYqd1EYNjB-OZqpw,241
|
|
|
10
10
|
cadwyn/exceptions.py,sha256=8D1G7ewLrMF5jq7leald1g0ulcH9zQl8ufEK3b7HHAE,1749
|
|
11
11
|
cadwyn/middleware.py,sha256=jtcysj66Fck_3EteK0zLJCOTMms3g6avi3U8lV-roQI,4316
|
|
12
12
|
cadwyn/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
13
|
-
cadwyn/route_generation.py,sha256=
|
|
13
|
+
cadwyn/route_generation.py,sha256=Po9wC4IvLBgX6EodWH3JFzEO7j3ckoXmIKMO-ubCGcA,25194
|
|
14
14
|
cadwyn/routing.py,sha256=EkV38cDQFAtR1M_fGWeq81lYaSPuDK4Pr8fjTTJVZvY,6912
|
|
15
15
|
cadwyn/schema_generation.py,sha256=QK_G-G56S1brGTSpEGEE77tbifSi7IzwNK1oiVfMkPA,46850
|
|
16
16
|
cadwyn/static/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -20,10 +20,10 @@ cadwyn/structure/common.py,sha256=YuyfYMxkJcj2c5SFh9teBoEC2xLO5_2QjPzYjwdZcTs,47
|
|
|
20
20
|
cadwyn/structure/data.py,sha256=NWURVnP_84VI2ugp9ppo0Ofyve3pVYjymF9K82Jh-SA,7791
|
|
21
21
|
cadwyn/structure/endpoints.py,sha256=zUgzglNhBPnmWdJ03A8pFT4zPs_lj8nQ7c7Uo2d-ejU,6246
|
|
22
22
|
cadwyn/structure/enums.py,sha256=4FCc9aniLE3VuWAVIacrNP_FWxTIUm9JkeeHA_zZdwQ,1254
|
|
23
|
-
cadwyn/structure/schemas.py,sha256=
|
|
24
|
-
cadwyn/structure/versions.py,sha256=
|
|
25
|
-
cadwyn-5.
|
|
26
|
-
cadwyn-5.
|
|
27
|
-
cadwyn-5.
|
|
28
|
-
cadwyn-5.
|
|
29
|
-
cadwyn-5.
|
|
23
|
+
cadwyn/structure/schemas.py,sha256=O9yNw1OB0Qz-PvNB0FYlQm34gQsjyG2l9gg9x-RnJIY,10781
|
|
24
|
+
cadwyn/structure/versions.py,sha256=eEF5FUrao3bYd-OiZeyG0fkozuThRqhW7sEzRNhdsfQ,34440
|
|
25
|
+
cadwyn-5.2.0.dist-info/METADATA,sha256=Z5KXqBdEg4NRb7oopNkvUP7bDpHC_Y-UYEXnvydFhBU,4529
|
|
26
|
+
cadwyn-5.2.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
27
|
+
cadwyn-5.2.0.dist-info/entry_points.txt,sha256=mGX8wl-Xfhpr5M93SUmkykaqinUaYAvW9rtDSX54gx0,47
|
|
28
|
+
cadwyn-5.2.0.dist-info/licenses/LICENSE,sha256=KeCWewiDQYpmSnzF-p_0YpoWiyDcUPaCuG8OWQs4ig4,1072
|
|
29
|
+
cadwyn-5.2.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|