cadwyn 5.4.5__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 CHANGED
@@ -2,9 +2,13 @@ import copy
2
2
  import sys
3
3
  from enum import auto
4
4
  from logging import getLogger
5
- from typing import TYPE_CHECKING, Any, Literal, TypeVar, Union, cast, get_args
5
+ from typing import Any, Literal, TypeVar, Union, cast, get_args
6
6
 
7
- from fastapi.openapi.constants import REF_TEMPLATE
7
+ from fastapi._compat import (
8
+ get_compat_model_name_map,
9
+ get_definitions,
10
+ )
11
+ from fastapi._compat.v2 import ModelField
8
12
  from fastapi.openapi.utils import (
9
13
  get_fields_from_routes,
10
14
  get_openapi,
@@ -35,9 +39,6 @@ from .structure.schemas import (
35
39
  ValidatorExistedInstruction,
36
40
  )
37
41
 
38
- if TYPE_CHECKING:
39
- from fastapi._compat import ModelField
40
-
41
42
  if sys.version_info >= (3, 11): # pragma: no cover
42
43
  from enum import StrEnum
43
44
  else: # pragma: no cover
@@ -89,7 +90,7 @@ def _generate_changelog(versions: VersionBundle, router: _RootCadwynAPIRouter) -
89
90
  version_change,
90
91
  generator_from_newer_version,
91
92
  generator_from_older_version,
92
- schemas_from_older_version,
93
+ schemas_from_older_version, # pyright: ignore[reportArgumentType]
93
94
  cast("list[APIRoute]", routes_from_newer_version),
94
95
  )
95
96
  if changelog_entry is not None: # pragma: no branch # This should never happen
@@ -153,21 +154,22 @@ def _get_all_pydantic_models_from_generic(annotation: Any) -> list[type[BaseMode
153
154
 
154
155
 
155
156
  def _get_openapi_representation_of_a_field(model: type[BaseModel], field_name: str) -> dict:
156
- from fastapi._compat import (
157
- GenerateJsonSchema,
158
- ModelField,
159
- get_compat_model_name_map,
160
- get_definitions,
161
- )
162
-
163
157
  class CadwynDummyModelForRepresentation(BaseModel):
164
158
  my_field: model
165
159
 
166
- model_name_map = get_compat_model_name_map([CadwynDummyModelForRepresentation.model_fields["my_field"]])
167
- schema_generator = GenerateJsonSchema(ref_template=REF_TEMPLATE)
160
+ model_name_map = get_compat_model_name_map(
161
+ [
162
+ CadwynDummyModelForRepresentation.model_fields["my_field"], # pyright: ignore[reportArgumentType]
163
+ ]
164
+ )
165
+
168
166
  _, definitions = get_definitions(
169
- fields=[ModelField(CadwynDummyModelForRepresentation.model_fields["my_field"], "my_field")],
170
- schema_generator=schema_generator,
167
+ fields=[
168
+ ModelField(
169
+ CadwynDummyModelForRepresentation.model_fields["my_field"],
170
+ "my_field",
171
+ ), # pyright: ignore[reportArgumentType]
172
+ ],
171
173
  model_name_map=model_name_map,
172
174
  separate_input_output_schemas=False,
173
175
  )
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: cadwyn
3
- Version: 5.4.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.112.4
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.112.3; extra == 'standard'
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
 
@@ -5,7 +5,7 @@ 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=gJnK2Rtl2svVZYQ_J2F6kkfzdmXNgsKmI3MzuXS9dKQ,19738
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
@@ -24,8 +24,8 @@ cadwyn/structure/endpoints.py,sha256=OYNaZ76VidtSutQfteFMba5nNIXtEjwCAvgpy3fRBT4
24
24
  cadwyn/structure/enums.py,sha256=4FCc9aniLE3VuWAVIacrNP_FWxTIUm9JkeeHA_zZdwQ,1254
25
25
  cadwyn/structure/schemas.py,sha256=kuQJg60VpWHZkSPvrbvd9pe-Zetq8as5YYrERsG3IE8,10785
26
26
  cadwyn/structure/versions.py,sha256=3ZDKewBHHWmAwhOQbIR5p17ANzqglMDTvYUGKTAqXyk,34710
27
- cadwyn-5.4.5.dist-info/METADATA,sha256=mgh_IMJ36E6I5rV8cyGSUR3e2QrEbYyUskWpimCbFLo,4504
28
- cadwyn-5.4.5.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
29
- cadwyn-5.4.5.dist-info/entry_points.txt,sha256=mGX8wl-Xfhpr5M93SUmkykaqinUaYAvW9rtDSX54gx0,47
30
- cadwyn-5.4.5.dist-info/licenses/LICENSE,sha256=KeCWewiDQYpmSnzF-p_0YpoWiyDcUPaCuG8OWQs4ig4,1072
31
- cadwyn-5.4.5.dist-info/RECORD,,
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