cadwyn 3.15.7__tar.gz → 3.15.8__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.

Files changed (37) hide show
  1. {cadwyn-3.15.7 → cadwyn-3.15.8}/PKG-INFO +1 -1
  2. {cadwyn-3.15.7 → cadwyn-3.15.8}/cadwyn/_asts.py +0 -1
  3. {cadwyn-3.15.7 → cadwyn-3.15.8}/cadwyn/codegen/_common.py +2 -1
  4. {cadwyn-3.15.7 → cadwyn-3.15.8}/cadwyn/structure/modules.py +2 -1
  5. {cadwyn-3.15.7 → cadwyn-3.15.8}/cadwyn/structure/versions.py +4 -1
  6. {cadwyn-3.15.7 → cadwyn-3.15.8}/pyproject.toml +1 -1
  7. {cadwyn-3.15.7 → cadwyn-3.15.8}/LICENSE +0 -0
  8. {cadwyn-3.15.7 → cadwyn-3.15.8}/README.md +0 -0
  9. {cadwyn-3.15.7 → cadwyn-3.15.8}/cadwyn/__init__.py +0 -0
  10. {cadwyn-3.15.7 → cadwyn-3.15.8}/cadwyn/__main__.py +0 -0
  11. {cadwyn-3.15.7 → cadwyn-3.15.8}/cadwyn/_compat.py +0 -0
  12. {cadwyn-3.15.7 → cadwyn-3.15.8}/cadwyn/_package_utils.py +0 -0
  13. {cadwyn-3.15.7 → cadwyn-3.15.8}/cadwyn/_utils.py +0 -0
  14. {cadwyn-3.15.7 → cadwyn-3.15.8}/cadwyn/applications.py +0 -0
  15. {cadwyn-3.15.7 → cadwyn-3.15.8}/cadwyn/codegen/README.md +0 -0
  16. {cadwyn-3.15.7 → cadwyn-3.15.8}/cadwyn/codegen/__init__.py +0 -0
  17. {cadwyn-3.15.7 → cadwyn-3.15.8}/cadwyn/codegen/_main.py +0 -0
  18. {cadwyn-3.15.7 → cadwyn-3.15.8}/cadwyn/codegen/_plugins/__init__.py +0 -0
  19. {cadwyn-3.15.7 → cadwyn-3.15.8}/cadwyn/codegen/_plugins/class_migrations.py +0 -0
  20. {cadwyn-3.15.7 → cadwyn-3.15.8}/cadwyn/codegen/_plugins/class_rebuilding.py +0 -0
  21. {cadwyn-3.15.7 → cadwyn-3.15.8}/cadwyn/codegen/_plugins/class_renaming.py +0 -0
  22. {cadwyn-3.15.7 → cadwyn-3.15.8}/cadwyn/codegen/_plugins/import_auto_adding.py +0 -0
  23. {cadwyn-3.15.7 → cadwyn-3.15.8}/cadwyn/codegen/_plugins/module_migrations.py +0 -0
  24. {cadwyn-3.15.7 → cadwyn-3.15.8}/cadwyn/exceptions.py +0 -0
  25. {cadwyn-3.15.7 → cadwyn-3.15.8}/cadwyn/main.py +0 -0
  26. {cadwyn-3.15.7 → cadwyn-3.15.8}/cadwyn/middleware.py +0 -0
  27. {cadwyn-3.15.7 → cadwyn-3.15.8}/cadwyn/py.typed +0 -0
  28. {cadwyn-3.15.7 → cadwyn-3.15.8}/cadwyn/route_generation.py +0 -0
  29. {cadwyn-3.15.7 → cadwyn-3.15.8}/cadwyn/routing.py +0 -0
  30. {cadwyn-3.15.7 → cadwyn-3.15.8}/cadwyn/static/__init__.py +0 -0
  31. {cadwyn-3.15.7 → cadwyn-3.15.8}/cadwyn/static/docs.html +0 -0
  32. {cadwyn-3.15.7 → cadwyn-3.15.8}/cadwyn/structure/__init__.py +0 -0
  33. {cadwyn-3.15.7 → cadwyn-3.15.8}/cadwyn/structure/common.py +0 -0
  34. {cadwyn-3.15.7 → cadwyn-3.15.8}/cadwyn/structure/data.py +0 -0
  35. {cadwyn-3.15.7 → cadwyn-3.15.8}/cadwyn/structure/endpoints.py +0 -0
  36. {cadwyn-3.15.7 → cadwyn-3.15.8}/cadwyn/structure/enums.py +0 -0
  37. {cadwyn-3.15.7 → cadwyn-3.15.8}/cadwyn/structure/schemas.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: cadwyn
3
- Version: 3.15.7
3
+ Version: 3.15.8
4
4
  Summary: Production-ready community-driven modern Stripe-like API versioning in FastAPI
5
5
  Home-page: https://github.com/zmievsa/cadwyn
6
6
  License: MIT
@@ -156,7 +156,6 @@ def transform_other(value: Any) -> Any:
156
156
  def _get_lambda_source_from_default_factory(source: str) -> str:
157
157
  found_lambdas: list[ast.Lambda] = []
158
158
 
159
- ast.parse(source)
160
159
  for node in ast.walk(ast.parse(source)):
161
160
  if isinstance(node, ast.keyword) and node.arg == "default_factory" and isinstance(node.value, ast.Lambda):
162
161
  found_lambdas.append(node.value)
@@ -1,6 +1,7 @@
1
1
  import ast
2
2
  import dataclasses
3
3
  import inspect
4
+ import textwrap
4
5
  from dataclasses import dataclass
5
6
  from enum import Enum
6
7
  from functools import cache
@@ -89,7 +90,7 @@ def get_fields_and_validators_from_model(
89
90
  {},
90
91
  )
91
92
  else:
92
- cls_ast = cast(ast.ClassDef, ast.parse(source).body[0])
93
+ cls_ast = cast(ast.ClassDef, ast.parse(textwrap.dedent(source)).body[0])
93
94
  validators: dict[str, _ValidatorWrapper] = {}
94
95
 
95
96
  validators_and_nones = (
@@ -1,5 +1,6 @@
1
1
  import ast
2
2
  import dataclasses
3
+ import textwrap
3
4
  from dataclasses import InitVar, dataclass
4
5
  from types import ModuleType
5
6
 
@@ -13,7 +14,7 @@ class AlterModuleInstruction:
13
14
  import_: ast.Import | ast.ImportFrom = dataclasses.field(init=False)
14
15
 
15
16
  def __post_init__(self, raw_import: str):
16
- parsed_body = ast.parse(raw_import).body
17
+ parsed_body = ast.parse(textwrap.dedent(raw_import)).body
17
18
  if len(parsed_body) > 1:
18
19
  raise CadwynStructureError(
19
20
  f"You have specified more than just a single import. This is prohibited. "
@@ -671,7 +671,10 @@ class VersionBundle:
671
671
  # that do not have it. We don't support it too.
672
672
  if response_info.body is not None and hasattr(response_info._response, "body"):
673
673
  # TODO (https://github.com/zmievsa/cadwyn/issues/51): Only do this if there are migrations
674
- if isinstance(response_info.body, str):
674
+ if (
675
+ isinstance(response_info.body, str)
676
+ and response_info._response.headers.get("content-type") != "application/json"
677
+ ):
675
678
  response_info._response.body = response_info.body.encode(response_info._response.charset)
676
679
  else:
677
680
  response_info._response.body = json.dumps(
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "cadwyn"
3
- version = "3.15.7"
3
+ version = "3.15.8"
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"
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