cadwyn 3.15.7__py3-none-any.whl → 3.15.8__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/_asts.py +0 -1
- cadwyn/codegen/_common.py +2 -1
- cadwyn/structure/modules.py +2 -1
- cadwyn/structure/versions.py +4 -1
- {cadwyn-3.15.7.dist-info → cadwyn-3.15.8.dist-info}/METADATA +1 -1
- {cadwyn-3.15.7.dist-info → cadwyn-3.15.8.dist-info}/RECORD +9 -9
- {cadwyn-3.15.7.dist-info → cadwyn-3.15.8.dist-info}/LICENSE +0 -0
- {cadwyn-3.15.7.dist-info → cadwyn-3.15.8.dist-info}/WHEEL +0 -0
- {cadwyn-3.15.7.dist-info → cadwyn-3.15.8.dist-info}/entry_points.txt +0 -0
cadwyn/_asts.py
CHANGED
|
@@ -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)
|
cadwyn/codegen/_common.py
CHANGED
|
@@ -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 = (
|
cadwyn/structure/modules.py
CHANGED
|
@@ -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. "
|
cadwyn/structure/versions.py
CHANGED
|
@@ -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
|
|
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,13 +1,13 @@
|
|
|
1
1
|
cadwyn/__init__.py,sha256=Wh_CtNgodacy8plxyDXCDb52CDftbql4jGXQ2pldX4s,605
|
|
2
2
|
cadwyn/__main__.py,sha256=cc-5iYItjxRnB09uxuxlEbjrLm1AEhXI2KrI5iakEOw,4376
|
|
3
|
-
cadwyn/_asts.py,sha256=
|
|
3
|
+
cadwyn/_asts.py,sha256=sUcuF8wALIMjuX1yow9bAoLZTwpoTKKJF8VGkpj7Els,10096
|
|
4
4
|
cadwyn/_compat.py,sha256=yAPmfGl2vVEYXlNHHPMoa2JkEJCVPjbP_Uz0WOIVOp4,5494
|
|
5
5
|
cadwyn/_package_utils.py,sha256=trxTYLmppv-10SKhScfyDQJh21rsQGFoLaOtHycKKR0,1443
|
|
6
6
|
cadwyn/_utils.py,sha256=BFsfZBpdoL5RMAaT1V1cXJVpTZCmwksQ-Le2MTHivGI,4841
|
|
7
7
|
cadwyn/applications.py,sha256=MkZ_vMs6YfnfuWPUzBjNBmrxtDa97etsV0zcnlv-iS0,15749
|
|
8
8
|
cadwyn/codegen/README.md,sha256=hc7AE87LsEsvbh-wX1H10JEWh-8bLHoe-1CkY3h00FI,879
|
|
9
9
|
cadwyn/codegen/__init__.py,sha256=JgddDjxMTjSfVrMXHwNu1ODgdn2QfPWpccrRKquBV6k,355
|
|
10
|
-
cadwyn/codegen/_common.py,sha256=
|
|
10
|
+
cadwyn/codegen/_common.py,sha256=fnz9Q-C7oZ3JKypPC_Xi6_CssF803XAUHL661IYY1hM,5910
|
|
11
11
|
cadwyn/codegen/_main.py,sha256=1mpXq_1AuZaAOeGjrCVMhcK7zhjmmlO82Q3ehoOOAfM,10483
|
|
12
12
|
cadwyn/codegen/_plugins/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
13
13
|
cadwyn/codegen/_plugins/class_migrations.py,sha256=kHZ-RMRTARZ4l70fxHMtul_204Ute2_yQmEej7wMwwo,20119
|
|
@@ -28,11 +28,11 @@ cadwyn/structure/common.py,sha256=6Z4nI97XPWTCinn6np73m-rLPyYNrz2fWXKJlqjsiaQ,26
|
|
|
28
28
|
cadwyn/structure/data.py,sha256=1ALPhBBCE_t4GrxM0Fa3hQ-jkORJgeWNySnZ42bsi0g,7382
|
|
29
29
|
cadwyn/structure/endpoints.py,sha256=JhTgVrqLjm5LkE9thjvU1UuWcSCmDgW2bMdqznsZb2Y,5777
|
|
30
30
|
cadwyn/structure/enums.py,sha256=iMokxA2QYJ61SzyB-Pmuq3y7KL7-e6TsnjLVUaVZQnw,954
|
|
31
|
-
cadwyn/structure/modules.py,sha256=
|
|
31
|
+
cadwyn/structure/modules.py,sha256=v3hA_KiqKwwo-ur0Z84WvqD0rTTe4fBTkMUK8SxUj7s,1301
|
|
32
32
|
cadwyn/structure/schemas.py,sha256=0ylArAkUw626VkUOJSulOwJs7CS6lrGBRECEG5HFD4Q,8897
|
|
33
|
-
cadwyn/structure/versions.py,sha256=
|
|
34
|
-
cadwyn-3.15.
|
|
35
|
-
cadwyn-3.15.
|
|
36
|
-
cadwyn-3.15.
|
|
37
|
-
cadwyn-3.15.
|
|
38
|
-
cadwyn-3.15.
|
|
33
|
+
cadwyn/structure/versions.py,sha256=iuVRvvMpADeeOnrxeD11x6KV8PhARqa6hTV78GbBuKI,37538
|
|
34
|
+
cadwyn-3.15.8.dist-info/LICENSE,sha256=KeCWewiDQYpmSnzF-p_0YpoWiyDcUPaCuG8OWQs4ig4,1072
|
|
35
|
+
cadwyn-3.15.8.dist-info/METADATA,sha256=HXUIHMmFwsuew9FOAAl_43IyIe1Lpk2sTSMZFE-O3nw,4397
|
|
36
|
+
cadwyn-3.15.8.dist-info/WHEEL,sha256=FMvqSimYX_P7y0a7UY-_Mc83r5zkBZsCYPm7Lr0Bsq4,88
|
|
37
|
+
cadwyn-3.15.8.dist-info/entry_points.txt,sha256=eO05hLn9GoRzzpwT9GONPmXKsonjuMNssM2D2WHWKGk,46
|
|
38
|
+
cadwyn-3.15.8.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|