cadwyn 3.4.3__tar.gz → 3.4.4__tar.gz
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-3.4.3 → cadwyn-3.4.4}/PKG-INFO +1 -1
- {cadwyn-3.4.3 → cadwyn-3.4.4}/cadwyn/structure/versions.py +5 -6
- {cadwyn-3.4.3 → cadwyn-3.4.4}/pyproject.toml +1 -1
- {cadwyn-3.4.3 → cadwyn-3.4.4}/setup.py +1 -1
- {cadwyn-3.4.3 → cadwyn-3.4.4}/LICENSE +0 -0
- {cadwyn-3.4.3 → cadwyn-3.4.4}/README.md +0 -0
- {cadwyn-3.4.3 → cadwyn-3.4.4}/cadwyn/__init__.py +0 -0
- {cadwyn-3.4.3 → cadwyn-3.4.4}/cadwyn/__main__.py +0 -0
- {cadwyn-3.4.3 → cadwyn-3.4.4}/cadwyn/_compat.py +0 -0
- {cadwyn-3.4.3 → cadwyn-3.4.4}/cadwyn/_package_utils.py +0 -0
- {cadwyn-3.4.3 → cadwyn-3.4.4}/cadwyn/_utils.py +0 -0
- {cadwyn-3.4.3 → cadwyn-3.4.4}/cadwyn/codegen/README.md +0 -0
- {cadwyn-3.4.3 → cadwyn-3.4.4}/cadwyn/codegen/__init__.py +0 -0
- {cadwyn-3.4.3 → cadwyn-3.4.4}/cadwyn/codegen/_asts.py +0 -0
- {cadwyn-3.4.3 → cadwyn-3.4.4}/cadwyn/codegen/_common.py +0 -0
- {cadwyn-3.4.3 → cadwyn-3.4.4}/cadwyn/codegen/_main.py +0 -0
- {cadwyn-3.4.3 → cadwyn-3.4.4}/cadwyn/codegen/_plugins/__init__.py +0 -0
- {cadwyn-3.4.3 → cadwyn-3.4.4}/cadwyn/codegen/_plugins/class_migrations.py +0 -0
- {cadwyn-3.4.3 → cadwyn-3.4.4}/cadwyn/codegen/_plugins/class_rebuilding.py +0 -0
- {cadwyn-3.4.3 → cadwyn-3.4.4}/cadwyn/codegen/_plugins/class_renaming.py +0 -0
- {cadwyn-3.4.3 → cadwyn-3.4.4}/cadwyn/codegen/_plugins/import_auto_adding.py +0 -0
- {cadwyn-3.4.3 → cadwyn-3.4.4}/cadwyn/codegen/_plugins/latest_version_aliasing.py +0 -0
- {cadwyn-3.4.3 → cadwyn-3.4.4}/cadwyn/codegen/_plugins/module_migrations.py +0 -0
- {cadwyn-3.4.3 → cadwyn-3.4.4}/cadwyn/exceptions.py +0 -0
- {cadwyn-3.4.3 → cadwyn-3.4.4}/cadwyn/main.py +0 -0
- {cadwyn-3.4.3 → cadwyn-3.4.4}/cadwyn/py.typed +0 -0
- {cadwyn-3.4.3 → cadwyn-3.4.4}/cadwyn/routing.py +0 -0
- {cadwyn-3.4.3 → cadwyn-3.4.4}/cadwyn/structure/__init__.py +0 -0
- {cadwyn-3.4.3 → cadwyn-3.4.4}/cadwyn/structure/common.py +0 -0
- {cadwyn-3.4.3 → cadwyn-3.4.4}/cadwyn/structure/data.py +0 -0
- {cadwyn-3.4.3 → cadwyn-3.4.4}/cadwyn/structure/endpoints.py +0 -0
- {cadwyn-3.4.3 → cadwyn-3.4.4}/cadwyn/structure/enums.py +0 -0
- {cadwyn-3.4.3 → cadwyn-3.4.4}/cadwyn/structure/modules.py +0 -0
- {cadwyn-3.4.3 → cadwyn-3.4.4}/cadwyn/structure/schemas.py +0 -0
|
@@ -303,13 +303,13 @@ class VersionBundle:
|
|
|
303
303
|
self,
|
|
304
304
|
body_type: type[BaseModel] | None,
|
|
305
305
|
latest_dependant_with_internal_schema: Dependant,
|
|
306
|
+
path: str,
|
|
306
307
|
request: FastapiRequest,
|
|
307
308
|
response: FastapiResponse,
|
|
308
309
|
request_info: RequestInfo,
|
|
309
310
|
current_version: VersionDate,
|
|
310
311
|
latest_route: APIRoute,
|
|
311
312
|
) -> dict[str, Any]:
|
|
312
|
-
path = request.scope["path"]
|
|
313
313
|
method = request.method
|
|
314
314
|
for v in reversed(self.versions):
|
|
315
315
|
if v.value <= current_version:
|
|
@@ -363,7 +363,6 @@ class VersionBundle:
|
|
|
363
363
|
Returns:
|
|
364
364
|
Modified data
|
|
365
365
|
"""
|
|
366
|
-
|
|
367
366
|
for v in self.versions:
|
|
368
367
|
if v.value <= current_version:
|
|
369
368
|
break
|
|
@@ -396,7 +395,6 @@ class VersionBundle:
|
|
|
396
395
|
async def decorator(*args: Any, **kwargs: Any) -> _R:
|
|
397
396
|
request: FastapiRequest = kwargs[request_param_name]
|
|
398
397
|
response: FastapiResponse = kwargs[response_param_name]
|
|
399
|
-
path = request.scope["path"]
|
|
400
398
|
method = request.method
|
|
401
399
|
kwargs = await self._convert_endpoint_kwargs_to_version(
|
|
402
400
|
template_module_body_field_for_request_migrations,
|
|
@@ -413,7 +411,7 @@ class VersionBundle:
|
|
|
413
411
|
return await self._convert_endpoint_response_to_version(
|
|
414
412
|
endpoint,
|
|
415
413
|
latest_route,
|
|
416
|
-
|
|
414
|
+
route,
|
|
417
415
|
method,
|
|
418
416
|
response_param_name,
|
|
419
417
|
kwargs,
|
|
@@ -433,7 +431,7 @@ class VersionBundle:
|
|
|
433
431
|
self,
|
|
434
432
|
func_to_get_response_from: Endpoint,
|
|
435
433
|
latest_route: APIRoute,
|
|
436
|
-
|
|
434
|
+
route: APIRoute,
|
|
437
435
|
method: str,
|
|
438
436
|
response_param_name: str,
|
|
439
437
|
kwargs: dict[str, Any],
|
|
@@ -480,7 +478,7 @@ class VersionBundle:
|
|
|
480
478
|
response_info,
|
|
481
479
|
api_version,
|
|
482
480
|
latest_route,
|
|
483
|
-
path,
|
|
481
|
+
route.path,
|
|
484
482
|
method,
|
|
485
483
|
)
|
|
486
484
|
if isinstance(response_or_response_body, FastapiResponse):
|
|
@@ -545,6 +543,7 @@ class VersionBundle:
|
|
|
545
543
|
new_kwargs = await self._migrate_request(
|
|
546
544
|
template_module_body_field_for_request_migrations,
|
|
547
545
|
latest_dependant_with_internal_schema,
|
|
546
|
+
route.path,
|
|
548
547
|
request,
|
|
549
548
|
response,
|
|
550
549
|
request_info,
|
|
@@ -22,7 +22,7 @@ entry_points = \
|
|
|
22
22
|
|
|
23
23
|
setup_kwargs = {
|
|
24
24
|
'name': 'cadwyn',
|
|
25
|
-
'version': '3.4.
|
|
25
|
+
'version': '3.4.4',
|
|
26
26
|
'description': 'Production-ready community-driven modern Stripe-like API versioning in FastAPI',
|
|
27
27
|
'long_description': '# Cadwyn\n\nProduction-ready community-driven modern [Stripe-like](https://stripe.com/blog/api-versioning) API versioning in FastAPI\n\n---\n\n<p align="center">\n<a href="https://github.com/zmievsa/cadwyn/actions?query=workflow%3ATests+event%3Apush+branch%3Amain" target="_blank">\n <img src="https://github.com/zmievsa/cadwyn/actions/workflows/test.yaml/badge.svg?branch=main&event=push" alt="Test">\n</a>\n<a href="https://codecov.io/gh/ovsyanka83/cadwyn" target="_blank">\n <img src="https://img.shields.io/codecov/c/github/ovsyanka83/cadwyn?color=%2334D058" alt="Coverage">\n</a>\n<a href="https://pypi.org/project/cadwyn/" target="_blank">\n <img alt="PyPI" src="https://img.shields.io/pypi/v/cadwyn?color=%2334D058&label=pypi%20package" alt="Package version">\n</a>\n<a href="https://pypi.org/project/cadwyn/" target="_blank">\n <img src="https://img.shields.io/pypi/pyversions/cadwyn?color=%2334D058" alt="Supported Python versions">\n</a>\n</p>\n\n## Who is this for?\n\nCadwyn allows you to support a single version of your code while auto-generating the schemas and routes for older versions. You keep API versioning encapsulated in small and independent "version change" modules while your business logic stays simple and knows nothing about versioning.\n\nIts [approach](https://docs.cadwyn.dev/theory/#ii-migration-based-response-building) will be useful if you want to:\n\n1. Support many API versions for a long time\n2. Effortlessly backport features and bugfixes to older API versions\n\nWhether you are a newbie in API versioning, a pro looking for a sophisticated tool, an experimenter looking to build a similar framework, or even someone who just wants to learn about all approaches to API versioning -- Cadwyn has the functionality, theory, and documentation to cover all the mentioned use cases.\n\n## Get started\n\nThe [documentation](https://docs.cadwyn.dev) has everything you need to succeed.\n\n## Sponsors\n\nThese 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!\n\n[](https://docs.monite.com/)\n',
|
|
28
28
|
'author': 'Stanislav Zmiev',
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|