sera-2 1.9.0__py3-none-any.whl → 1.9.1__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.
sera/make/make_python_model.py
CHANGED
@@ -3,6 +3,7 @@ from __future__ import annotations
|
|
3
3
|
from typing import Callable, Sequence
|
4
4
|
|
5
5
|
from codegen.models import AST, DeferredVar, PredefinedFn, Program, expr, stmt
|
6
|
+
|
6
7
|
from sera.misc import (
|
7
8
|
assert_isinstance,
|
8
9
|
assert_not_null,
|
@@ -206,12 +207,6 @@ def make_python_data_model(
|
|
206
207
|
program.import_(pytype.dep, True)
|
207
208
|
|
208
209
|
pytype_type = pytype.type
|
209
|
-
if prop.data.is_private:
|
210
|
-
program.import_("typing.Union", True)
|
211
|
-
program.import_("sera.typing.UnsetType", True)
|
212
|
-
program.import_("sera.typing.UNSET", True)
|
213
|
-
pytype_type = f"Union[{pytype_type}, UnsetType]"
|
214
|
-
|
215
210
|
if len(prop.data.constraints) > 0:
|
216
211
|
# if the property has constraints, we need to figure out
|
217
212
|
program.import_("typing.Annotated", True)
|
@@ -223,6 +218,12 @@ def make_python_data_model(
|
|
223
218
|
else:
|
224
219
|
raise NotImplementedError(prop.data.constraints)
|
225
220
|
|
221
|
+
if prop.data.is_private:
|
222
|
+
program.import_("typing.Union", True)
|
223
|
+
program.import_("sera.typing.UnsetType", True)
|
224
|
+
program.import_("sera.typing.UNSET", True)
|
225
|
+
pytype_type = f"Union[{pytype_type}, UnsetType]"
|
226
|
+
|
226
227
|
prop_default_value = None
|
227
228
|
if prop.data.is_private:
|
228
229
|
prop_default_value = expr.ExprIdent("UNSET")
|
@@ -10,7 +10,7 @@ sera/make/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
10
10
|
sera/make/__main__.py,sha256=G5O7s6135-708honwqMFn2yPTs06WbGQTHpupID0eZ4,1417
|
11
11
|
sera/make/make_app.py,sha256=n9NtW73O3s_5Q31VHIRmnd-jEIcpDO7ksAsOdovde2s,5999
|
12
12
|
sera/make/make_python_api.py,sha256=FcklRwGDGTKPjuhbHKyEog8PYPACi-5DA_nB1ZgxeJU,29424
|
13
|
-
sera/make/make_python_model.py,sha256=
|
13
|
+
sera/make/make_python_model.py,sha256=v5edXKMTQ2XAYDoM7fBONx3S9H6DRUPQp9UwWWUowLg,36594
|
14
14
|
sera/make/make_python_services.py,sha256=RsinYZdfkrTlTn9CT50VgqGs9w6IZawsJx-KEmqfnEY,2062
|
15
15
|
sera/make/make_typescript_model.py,sha256=fMjz4YxdGHijb2pHI4xj7rKJf1PxyJxVLYW0ivsu70c,50128
|
16
16
|
sera/misc/__init__.py,sha256=Dh4uDq0D4N53h3zhvmwfa5a0TPVRSUvLzb0hkFuPirk,411
|
@@ -29,6 +29,6 @@ sera/models/_parse.py,sha256=sJYfQtwek96ltpgxExG4xUbiLnU3qvNYhTP1CeyXGjs,9746
|
|
29
29
|
sera/models/_property.py,sha256=CmEmgOShtSyNFq05YW3tGupwCIVRzPMKudXWld8utPk,5530
|
30
30
|
sera/models/_schema.py,sha256=r-Gqg9Lb_wR3UrbNvfXXgt_qs5bts0t2Ve7aquuF_OI,1155
|
31
31
|
sera/typing.py,sha256=Q4QMfbtfrCjC9tFfsZPhsAnbNX4lm4NHQ9lmjNXYdV0,772
|
32
|
-
sera_2-1.9.
|
33
|
-
sera_2-1.9.
|
34
|
-
sera_2-1.9.
|
32
|
+
sera_2-1.9.1.dist-info/METADATA,sha256=Xg1hqLX0htdcQaJxgMUXAr4e_DAiDp3BiyTXXtIfHpg,856
|
33
|
+
sera_2-1.9.1.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
|
34
|
+
sera_2-1.9.1.dist-info/RECORD,,
|
File without changes
|