cadwyn 3.6.3__tar.gz → 3.6.5__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.6.3 → cadwyn-3.6.5}/PKG-INFO +1 -1
- {cadwyn-3.6.3 → cadwyn-3.6.5}/cadwyn/routing.py +17 -13
- {cadwyn-3.6.3 → cadwyn-3.6.5}/pyproject.toml +9 -7
- {cadwyn-3.6.3 → cadwyn-3.6.5}/LICENSE +0 -0
- {cadwyn-3.6.3 → cadwyn-3.6.5}/README.md +0 -0
- {cadwyn-3.6.3 → cadwyn-3.6.5}/cadwyn/__init__.py +0 -0
- {cadwyn-3.6.3 → cadwyn-3.6.5}/cadwyn/__main__.py +0 -0
- {cadwyn-3.6.3 → cadwyn-3.6.5}/cadwyn/_asts.py +0 -0
- {cadwyn-3.6.3 → cadwyn-3.6.5}/cadwyn/_compat.py +0 -0
- {cadwyn-3.6.3 → cadwyn-3.6.5}/cadwyn/_package_utils.py +0 -0
- {cadwyn-3.6.3 → cadwyn-3.6.5}/cadwyn/_utils.py +0 -0
- {cadwyn-3.6.3 → cadwyn-3.6.5}/cadwyn/applications.py +0 -0
- {cadwyn-3.6.3 → cadwyn-3.6.5}/cadwyn/codegen/README.md +0 -0
- {cadwyn-3.6.3 → cadwyn-3.6.5}/cadwyn/codegen/__init__.py +0 -0
- {cadwyn-3.6.3 → cadwyn-3.6.5}/cadwyn/codegen/_common.py +0 -0
- {cadwyn-3.6.3 → cadwyn-3.6.5}/cadwyn/codegen/_main.py +0 -0
- {cadwyn-3.6.3 → cadwyn-3.6.5}/cadwyn/codegen/_plugins/__init__.py +0 -0
- {cadwyn-3.6.3 → cadwyn-3.6.5}/cadwyn/codegen/_plugins/class_migrations.py +0 -0
- {cadwyn-3.6.3 → cadwyn-3.6.5}/cadwyn/codegen/_plugins/class_rebuilding.py +0 -0
- {cadwyn-3.6.3 → cadwyn-3.6.5}/cadwyn/codegen/_plugins/class_renaming.py +0 -0
- {cadwyn-3.6.3 → cadwyn-3.6.5}/cadwyn/codegen/_plugins/import_auto_adding.py +0 -0
- {cadwyn-3.6.3 → cadwyn-3.6.5}/cadwyn/codegen/_plugins/latest_version_aliasing.py +0 -0
- {cadwyn-3.6.3 → cadwyn-3.6.5}/cadwyn/codegen/_plugins/module_migrations.py +0 -0
- {cadwyn-3.6.3 → cadwyn-3.6.5}/cadwyn/exceptions.py +0 -0
- {cadwyn-3.6.3 → cadwyn-3.6.5}/cadwyn/main.py +0 -0
- {cadwyn-3.6.3 → cadwyn-3.6.5}/cadwyn/py.typed +0 -0
- {cadwyn-3.6.3 → cadwyn-3.6.5}/cadwyn/structure/__init__.py +0 -0
- {cadwyn-3.6.3 → cadwyn-3.6.5}/cadwyn/structure/common.py +0 -0
- {cadwyn-3.6.3 → cadwyn-3.6.5}/cadwyn/structure/data.py +0 -0
- {cadwyn-3.6.3 → cadwyn-3.6.5}/cadwyn/structure/endpoints.py +0 -0
- {cadwyn-3.6.3 → cadwyn-3.6.5}/cadwyn/structure/enums.py +0 -0
- {cadwyn-3.6.3 → cadwyn-3.6.5}/cadwyn/structure/modules.py +0 -0
- {cadwyn-3.6.3 → cadwyn-3.6.5}/cadwyn/structure/schemas.py +0 -0
- {cadwyn-3.6.3 → cadwyn-3.6.5}/cadwyn/structure/versions.py +0 -0
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import functools
|
|
2
2
|
import inspect
|
|
3
3
|
import re
|
|
4
|
+
import types
|
|
4
5
|
import typing
|
|
5
6
|
import warnings
|
|
6
7
|
from collections import defaultdict
|
|
@@ -541,20 +542,20 @@ def _modify_callable(
|
|
|
541
542
|
modify_annotations: Callable[[dict[str, Any]], dict[str, Any]] = lambda a: a,
|
|
542
543
|
modify_defaults: Callable[[tuple[Any, ...]], tuple[Any, ...]] = lambda a: a,
|
|
543
544
|
):
|
|
544
|
-
|
|
545
|
+
annotation_modifying_wrapper = _copy_function(call)
|
|
545
546
|
old_params = inspect.signature(call).parameters
|
|
546
|
-
callable_annotations =
|
|
547
|
+
callable_annotations = annotation_modifying_wrapper.__annotations__
|
|
547
548
|
|
|
548
|
-
|
|
549
|
-
|
|
549
|
+
annotation_modifying_wrapper.__annotations__ = modify_annotations(callable_annotations)
|
|
550
|
+
annotation_modifying_wrapper.__defaults__ = modify_defaults(
|
|
550
551
|
tuple(p.default for p in old_params.values() if p.default is not inspect.Signature.empty),
|
|
551
552
|
)
|
|
552
|
-
|
|
553
|
-
|
|
553
|
+
annotation_modifying_wrapper.__signature__ = _generate_signature(
|
|
554
|
+
annotation_modifying_wrapper,
|
|
554
555
|
old_params,
|
|
555
556
|
)
|
|
556
557
|
|
|
557
|
-
return
|
|
558
|
+
return annotation_modifying_wrapper
|
|
558
559
|
|
|
559
560
|
|
|
560
561
|
def _remake_endpoint_dependencies(route: fastapi.routing.APIRoute):
|
|
@@ -718,10 +719,13 @@ def _copy_function(function: _T) -> _T:
|
|
|
718
719
|
while hasattr(function, "__alt_wrapped__"):
|
|
719
720
|
function = function.__alt_wrapped__
|
|
720
721
|
|
|
722
|
+
if not isinstance(function, types.FunctionType):
|
|
723
|
+
# This means that the callable is actually an instance of a regular class
|
|
724
|
+
function = function.__call__
|
|
721
725
|
if inspect.iscoroutinefunction(function):
|
|
722
726
|
|
|
723
727
|
@functools.wraps(function)
|
|
724
|
-
async def
|
|
728
|
+
async def annotation_modifying_wrapper( # pyright: ignore[reportRedeclaration]
|
|
725
729
|
*args: Any,
|
|
726
730
|
**kwargs: Any,
|
|
727
731
|
) -> Any:
|
|
@@ -730,16 +734,16 @@ def _copy_function(function: _T) -> _T:
|
|
|
730
734
|
else:
|
|
731
735
|
|
|
732
736
|
@functools.wraps(function)
|
|
733
|
-
def
|
|
737
|
+
def annotation_modifying_wrapper(
|
|
734
738
|
*args: Any,
|
|
735
739
|
**kwargs: Any,
|
|
736
740
|
) -> Any:
|
|
737
741
|
return function(*args, **kwargs)
|
|
738
742
|
|
|
739
743
|
# Otherwise it will have the same signature as __wrapped__ due to how inspect module works
|
|
740
|
-
|
|
741
|
-
|
|
744
|
+
annotation_modifying_wrapper.__alt_wrapped__ = ( # pyright: ignore[reportAttributeAccessIssue]
|
|
745
|
+
annotation_modifying_wrapper.__wrapped__
|
|
742
746
|
)
|
|
743
|
-
del
|
|
747
|
+
del annotation_modifying_wrapper.__wrapped__
|
|
744
748
|
|
|
745
|
-
return cast(_T,
|
|
749
|
+
return cast(_T, annotation_modifying_wrapper)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[tool.poetry]
|
|
2
2
|
name = "cadwyn"
|
|
3
|
-
version = "3.6.
|
|
3
|
+
version = "3.6.5"
|
|
4
4
|
description = "Production-ready community-driven modern Stripe-like API versioning in FastAPI"
|
|
5
5
|
authors = ["Stanislav Zmiev <zmievsa@gmail.com>"]
|
|
6
6
|
license = "MIT"
|
|
@@ -135,6 +135,8 @@ reportCircularImports = true
|
|
|
135
135
|
[tool.ruff]
|
|
136
136
|
target-version = "py310"
|
|
137
137
|
line-length = 120
|
|
138
|
+
|
|
139
|
+
[tool.ruff.lint]
|
|
138
140
|
select = [
|
|
139
141
|
"F", # pyflakes
|
|
140
142
|
"E", # pycodestyle errors
|
|
@@ -211,11 +213,7 @@ ignore = [
|
|
|
211
213
|
"COM819", # Checks for the presence of prohibited trailing commas
|
|
212
214
|
]
|
|
213
215
|
|
|
214
|
-
[tool.ruff.
|
|
215
|
-
quote-style = "double"
|
|
216
|
-
indent-style = "space"
|
|
217
|
-
|
|
218
|
-
[tool.ruff.per-file-ignores]
|
|
216
|
+
[tool.ruff.lint.per-file-ignores]
|
|
219
217
|
"tests/*" = [
|
|
220
218
|
"S", # ignore bandit security issues in tests
|
|
221
219
|
"B018", # ignore useless expressions in tests
|
|
@@ -231,9 +229,13 @@ indent-style = "space"
|
|
|
231
229
|
"ERA001", # Found commented-out code (it's not actually commented out. It's just comments)
|
|
232
230
|
]
|
|
233
231
|
|
|
234
|
-
[tool.ruff.mccabe]
|
|
232
|
+
[tool.ruff.lint.mccabe]
|
|
235
233
|
max-complexity = 14
|
|
236
234
|
|
|
235
|
+
[tool.ruff.format]
|
|
236
|
+
quote-style = "double"
|
|
237
|
+
indent-style = "space"
|
|
238
|
+
|
|
237
239
|
[build-system]
|
|
238
240
|
requires = ["poetry-core>=1.0.0"]
|
|
239
241
|
build-backend = "poetry.core.masonry.api"
|
|
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
|
|
File without changes
|