cadwyn 5.4.4__py3-none-any.whl → 5.5.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/changelogs.py +16 -10
- cadwyn/schema_generation.py +1 -1
- cadwyn/structure/endpoints.py +1 -1
- cadwyn/structure/versions.py +1 -1
- {cadwyn-5.4.4.dist-info → cadwyn-5.5.0.dist-info}/METADATA +3 -26
- {cadwyn-5.4.4.dist-info → cadwyn-5.5.0.dist-info}/RECORD +9 -9
- {cadwyn-5.4.4.dist-info → cadwyn-5.5.0.dist-info}/WHEEL +0 -0
- {cadwyn-5.4.4.dist-info → cadwyn-5.5.0.dist-info}/entry_points.txt +0 -0
- {cadwyn-5.4.4.dist-info → cadwyn-5.5.0.dist-info}/licenses/LICENSE +0 -0
cadwyn/changelogs.py
CHANGED
|
@@ -5,12 +5,10 @@ from logging import getLogger
|
|
|
5
5
|
from typing import Any, Literal, TypeVar, Union, cast, get_args
|
|
6
6
|
|
|
7
7
|
from fastapi._compat import (
|
|
8
|
-
GenerateJsonSchema,
|
|
9
|
-
ModelField,
|
|
10
8
|
get_compat_model_name_map,
|
|
11
9
|
get_definitions,
|
|
12
10
|
)
|
|
13
|
-
from fastapi.
|
|
11
|
+
from fastapi._compat.v2 import ModelField
|
|
14
12
|
from fastapi.openapi.utils import (
|
|
15
13
|
get_fields_from_routes,
|
|
16
14
|
get_openapi,
|
|
@@ -92,7 +90,7 @@ def _generate_changelog(versions: VersionBundle, router: _RootCadwynAPIRouter) -
|
|
|
92
90
|
version_change,
|
|
93
91
|
generator_from_newer_version,
|
|
94
92
|
generator_from_older_version,
|
|
95
|
-
schemas_from_older_version,
|
|
93
|
+
schemas_from_older_version, # pyright: ignore[reportArgumentType]
|
|
96
94
|
cast("list[APIRoute]", routes_from_newer_version),
|
|
97
95
|
)
|
|
98
96
|
if changelog_entry is not None: # pragma: no branch # This should never happen
|
|
@@ -120,7 +118,7 @@ def _get_affected_model_names(
|
|
|
120
118
|
FieldDidntHaveInstruction,
|
|
121
119
|
],
|
|
122
120
|
generator_from_newer_version: SchemaGenerator,
|
|
123
|
-
schemas_from_last_version: list[ModelField],
|
|
121
|
+
schemas_from_last_version: "list[ModelField]",
|
|
124
122
|
):
|
|
125
123
|
changed_model = generator_from_newer_version._get_wrapper_for_model(instruction.schema)
|
|
126
124
|
annotations = [model.field_info.annotation for model in schemas_from_last_version]
|
|
@@ -159,11 +157,19 @@ def _get_openapi_representation_of_a_field(model: type[BaseModel], field_name: s
|
|
|
159
157
|
class CadwynDummyModelForRepresentation(BaseModel):
|
|
160
158
|
my_field: model
|
|
161
159
|
|
|
162
|
-
model_name_map = get_compat_model_name_map(
|
|
163
|
-
|
|
160
|
+
model_name_map = get_compat_model_name_map(
|
|
161
|
+
[
|
|
162
|
+
CadwynDummyModelForRepresentation.model_fields["my_field"], # pyright: ignore[reportArgumentType]
|
|
163
|
+
]
|
|
164
|
+
)
|
|
165
|
+
|
|
164
166
|
_, definitions = get_definitions(
|
|
165
|
-
fields=[
|
|
166
|
-
|
|
167
|
+
fields=[
|
|
168
|
+
ModelField(
|
|
169
|
+
CadwynDummyModelForRepresentation.model_fields["my_field"],
|
|
170
|
+
"my_field",
|
|
171
|
+
), # pyright: ignore[reportArgumentType]
|
|
172
|
+
],
|
|
167
173
|
model_name_map=model_name_map,
|
|
168
174
|
separate_input_output_schemas=False,
|
|
169
175
|
)
|
|
@@ -315,7 +321,7 @@ def _convert_version_change_instruction_to_changelog_entry( # noqa: C901
|
|
|
315
321
|
version_change: type[VersionChange],
|
|
316
322
|
generator_from_newer_version: SchemaGenerator,
|
|
317
323
|
generator_from_older_version: SchemaGenerator,
|
|
318
|
-
schemas_from_older_version: list[ModelField],
|
|
324
|
+
schemas_from_older_version: "list[ModelField]",
|
|
319
325
|
routes_from_newer_version: list[APIRoute],
|
|
320
326
|
):
|
|
321
327
|
if isinstance(instruction, EndpointDidntExistInstruction):
|
cadwyn/schema_generation.py
CHANGED
|
@@ -541,7 +541,7 @@ class _AsyncGeneratorCallableWrapper(_CallableWrapper):
|
|
|
541
541
|
class _AnnotationTransformer:
|
|
542
542
|
def __init__(self, generator: "SchemaGenerator") -> None:
|
|
543
543
|
# This cache is not here for speeding things up. It's for preventing the creation of copies of the same object
|
|
544
|
-
# because such copies could produce weird behaviors at runtime, especially if you/
|
|
544
|
+
# because such copies could produce weird behaviors at runtime, especially if you/FastAPI do any comparisons.
|
|
545
545
|
# It's defined here and not on the method because of this: https://youtu.be/sVjtp6tGo0g
|
|
546
546
|
self.generator = generator
|
|
547
547
|
# TODO: Rewrite this to memoize
|
cadwyn/structure/endpoints.py
CHANGED
|
@@ -18,7 +18,7 @@ HTTP_METHODS = {"GET", "POST", "PUT", "PATCH", "DELETE", "OPTIONS", "HEAD"}
|
|
|
18
18
|
|
|
19
19
|
@dataclass(**DATACLASS_SLOTS)
|
|
20
20
|
class EndpointAttributesPayload:
|
|
21
|
-
#
|
|
21
|
+
# FastAPI API routes also have "endpoint" and "dependency_overrides_provider" fields.
|
|
22
22
|
# We do not use them because:
|
|
23
23
|
# 1. "endpoint" must not change -- otherwise this versioning is doomed
|
|
24
24
|
# 2. "dependency_overrides_provider" is taken from router's attributes
|
cadwyn/structure/versions.py
CHANGED
|
@@ -694,7 +694,7 @@ class VersionBundle:
|
|
|
694
694
|
# We use this instead of `.body()` to automatically guess body type and load the correct body, even if it's a form
|
|
695
695
|
async def _get_body(
|
|
696
696
|
request: FastapiRequest, body_field: Union[ModelField, None], exit_stack: AsyncExitStack
|
|
697
|
-
): # pragma: no cover # This is from
|
|
697
|
+
): # pragma: no cover # This is from FastAPI
|
|
698
698
|
is_body_form = body_field and isinstance(body_field.field_info, params.Form)
|
|
699
699
|
try:
|
|
700
700
|
body: Any = None
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: cadwyn
|
|
3
|
-
Version: 5.
|
|
3
|
+
Version: 5.5.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
|
|
@@ -35,14 +35,14 @@ Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
|
35
35
|
Classifier: Typing :: Typed
|
|
36
36
|
Requires-Python: >=3.9
|
|
37
37
|
Requires-Dist: backports-strenum<2,>=1.3.1; python_version < '3.11'
|
|
38
|
-
Requires-Dist: fastapi>=0.
|
|
38
|
+
Requires-Dist: fastapi>=0.119.0
|
|
39
39
|
Requires-Dist: jinja2>=3.1.2
|
|
40
40
|
Requires-Dist: pydantic>=2.11.0
|
|
41
41
|
Requires-Dist: starlette>=0.30.0
|
|
42
42
|
Requires-Dist: typing-extensions>=4.8.0
|
|
43
43
|
Requires-Dist: typing-inspection>=0.4.0
|
|
44
44
|
Provides-Extra: standard
|
|
45
|
-
Requires-Dist: fastapi[standard]>=0.
|
|
45
|
+
Requires-Dist: fastapi[standard]>=0.119.0; extra == 'standard'
|
|
46
46
|
Requires-Dist: typer>=0.7.0; extra == 'standard'
|
|
47
47
|
Description-Content-Type: text/markdown
|
|
48
48
|
|
|
@@ -88,26 +88,3 @@ The [documentation](https://docs.cadwyn.dev) has everything you need to succeed.
|
|
|
88
88
|
## Sponsors
|
|
89
89
|
|
|
90
90
|
These are our gorgeous sponsors. They are using Cadwyn and are sponsoring it through various means. Contact [me](https://github.com/zmievsa) if you would like to become one, too!
|
|
91
|
-
|
|
92
|
-
## Contributors
|
|
93
|
-
|
|
94
|
-
<details>
|
|
95
|
-
|
|
96
|
-
<summary>Thanks goes to these wonderful people:</summary>
|
|
97
|
-
<a href="https://allcontributors.org/docs/en/emoji-key">Emoji Key </a>
|
|
98
|
-
|
|
99
|
-
<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
|
|
100
|
-
<!-- prettier-ignore-start -->
|
|
101
|
-
<!-- markdownlint-disable -->
|
|
102
|
-
|
|
103
|
-
<!-- markdownlint-restore -->
|
|
104
|
-
<!-- prettier-ignore-end -->
|
|
105
|
-
|
|
106
|
-
<!-- ALL-CONTRIBUTORS-LIST:END -->
|
|
107
|
-
|
|
108
|
-
This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification.
|
|
109
|
-
Contributions are welcome!
|
|
110
|
-
|
|
111
|
-
</details>
|
|
112
|
-
|
|
113
|
-
<!-- contributors-end -->
|
|
@@ -5,14 +5,14 @@ cadwyn/_importer.py,sha256=QV6HqODCG9K2oL4Vc15fAqL2-plMvUWw_cgaj4Ln4C8,1075
|
|
|
5
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=FALDl4v_8dJWdrpHEuvG34C_vfnKKh01rAOiyg5wVak,21200
|
|
8
|
-
cadwyn/changelogs.py,sha256=
|
|
8
|
+
cadwyn/changelogs.py,sha256=cie376hLvGaY4m3sQKPYOQ_McrD1bVD6aQk5swdIaTU,19700
|
|
9
9
|
cadwyn/dependencies.py,sha256=phUJ4Fy3UTegpOfDfHMjxsvASWo-1NQgwqphNnPdoVQ,241
|
|
10
10
|
cadwyn/exceptions.py,sha256=8D1G7ewLrMF5jq7leald1g0ulcH9zQl8ufEK3b7HHAE,1749
|
|
11
11
|
cadwyn/middleware.py,sha256=4Ziq1ysnc8j5KmeZpsr9VJKllEFC8uYwXnG01I2FPR4,4853
|
|
12
12
|
cadwyn/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
13
13
|
cadwyn/route_generation.py,sha256=conoTBtsOtjyiV2NdUxwGQX-h1zLyIjDQjD5bT2YSgg,27185
|
|
14
14
|
cadwyn/routing.py,sha256=Ii6Qbgm9lGks1IAk-kDuIu_dX3FXsA77KSfGOFmLbgc,7604
|
|
15
|
-
cadwyn/schema_generation.py,sha256=
|
|
15
|
+
cadwyn/schema_generation.py,sha256=Q0Ma_2XA5plPcZ7sxNK1jZxubGDNcc-XMka3TkvFgEI,48848
|
|
16
16
|
cadwyn/_internal/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
17
17
|
cadwyn/_internal/context_vars.py,sha256=VcM8eAoSlvrIMFQhjZmjflV5o1yrPSEZZGkwOK4OSf4,378
|
|
18
18
|
cadwyn/static/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -20,12 +20,12 @@ cadwyn/static/docs.html,sha256=WNm5ANJVy51TcIUFOaqKf1Z8eF86CC85TTHPxACtkzw,3455
|
|
|
20
20
|
cadwyn/structure/__init__.py,sha256=Wgvjdq3vfl9Yhe-BkcFGAMi_Co11YOfTmJQqgF5Gzx4,655
|
|
21
21
|
cadwyn/structure/common.py,sha256=YuyfYMxkJcj2c5SFh9teBoEC2xLO5_2QjPzYjwdZcTs,478
|
|
22
22
|
cadwyn/structure/data.py,sha256=eb4HlGTu3V_G5vJuQ4GLEaGd4LmPmFX3L8CXwJKzfOE,7795
|
|
23
|
-
cadwyn/structure/endpoints.py,sha256=
|
|
23
|
+
cadwyn/structure/endpoints.py,sha256=OYNaZ76VidtSutQfteFMba5nNIXtEjwCAvgpy3fRBT4,6246
|
|
24
24
|
cadwyn/structure/enums.py,sha256=4FCc9aniLE3VuWAVIacrNP_FWxTIUm9JkeeHA_zZdwQ,1254
|
|
25
25
|
cadwyn/structure/schemas.py,sha256=kuQJg60VpWHZkSPvrbvd9pe-Zetq8as5YYrERsG3IE8,10785
|
|
26
|
-
cadwyn/structure/versions.py,sha256=
|
|
27
|
-
cadwyn-5.
|
|
28
|
-
cadwyn-5.
|
|
29
|
-
cadwyn-5.
|
|
30
|
-
cadwyn-5.
|
|
31
|
-
cadwyn-5.
|
|
26
|
+
cadwyn/structure/versions.py,sha256=3ZDKewBHHWmAwhOQbIR5p17ANzqglMDTvYUGKTAqXyk,34710
|
|
27
|
+
cadwyn-5.5.0.dist-info/METADATA,sha256=-d8ZaNrOdst-t6hr2H8H1e8b_BD5QKidX4B96yhYIus,4504
|
|
28
|
+
cadwyn-5.5.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
29
|
+
cadwyn-5.5.0.dist-info/entry_points.txt,sha256=mGX8wl-Xfhpr5M93SUmkykaqinUaYAvW9rtDSX54gx0,47
|
|
30
|
+
cadwyn-5.5.0.dist-info/licenses/LICENSE,sha256=KeCWewiDQYpmSnzF-p_0YpoWiyDcUPaCuG8OWQs4ig4,1072
|
|
31
|
+
cadwyn-5.5.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|