modmex 1.2.3__tar.gz → 1.2.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.
- {modmex-1.2.3 → modmex-1.2.5}/PKG-INFO +1 -1
- {modmex-1.2.3 → modmex-1.2.5}/modmex/model_plans.py +4 -0
- {modmex-1.2.3 → modmex-1.2.5}/modmex/validation.py +3 -0
- {modmex-1.2.3 → modmex-1.2.5}/pyproject.toml +1 -1
- {modmex-1.2.3 → modmex-1.2.5}/LICENSE +0 -0
- {modmex-1.2.3 → modmex-1.2.5}/README.md +0 -0
- {modmex-1.2.3 → modmex-1.2.5}/modmex/__init__.py +0 -0
- {modmex-1.2.3 → modmex-1.2.5}/modmex/__init__.pyi +0 -0
- {modmex-1.2.3 → modmex-1.2.5}/modmex/base_model.py +0 -0
- {modmex-1.2.3 → modmex-1.2.5}/modmex/base_model.pyi +0 -0
- {modmex-1.2.3 → modmex-1.2.5}/modmex/datetime_parser.py +0 -0
- {modmex-1.2.3 → modmex-1.2.5}/modmex/errors.py +0 -0
- {modmex-1.2.3 → modmex-1.2.5}/modmex/fields.py +0 -0
- {modmex-1.2.3 → modmex-1.2.5}/modmex/py.typed +0 -0
- {modmex-1.2.3 → modmex-1.2.5}/modmex/rust_backend.py +0 -0
- {modmex-1.2.3 → modmex-1.2.5}/modmex/serialization.py +0 -0
- {modmex-1.2.3 → modmex-1.2.5}/modmex/type_resolution.py +0 -0
- {modmex-1.2.3 → modmex-1.2.5}/modmex-core/Cargo.lock +0 -0
- {modmex-1.2.3 → modmex-1.2.5}/modmex-core/Cargo.toml +0 -0
- {modmex-1.2.3 → modmex-1.2.5}/modmex-core/src/coerce.rs +0 -0
- {modmex-1.2.3 → modmex-1.2.5}/modmex-core/src/lib.rs +0 -0
- {modmex-1.2.3 → modmex-1.2.5}/modmex-core/src/model_core.rs +0 -0
- {modmex-1.2.3 → modmex-1.2.5}/modmex-core/src/types.rs +0 -0
|
@@ -249,6 +249,10 @@ def _rust_node_for(expected_type: Any, globalns: dict[str, Any], base_model_type
|
|
|
249
249
|
if issubclass(expected_type, Enum):
|
|
250
250
|
return (NODE_ENUM, expected_type)
|
|
251
251
|
if issubclass(expected_type, base_model_type):
|
|
252
|
+
# The Rust core builds a nested model straight from a dict and skips its field constraints
|
|
253
|
+
# (ge, le, min_length...), which run in Python. A model with constraints stays on the Python path.
|
|
254
|
+
if getattr(expected_type, "__modmex_has_constraints__", False):
|
|
255
|
+
return None
|
|
252
256
|
core = getattr(expected_type, "__modmex_core__", None)
|
|
253
257
|
schema = getattr(expected_type, "__modmex_rust_schema__", None)
|
|
254
258
|
if core is not None and schema:
|
|
@@ -613,6 +613,9 @@ def _compile_constraints(field: dataclasses.Field[Any]) -> ConstraintValidators:
|
|
|
613
613
|
return ()
|
|
614
614
|
|
|
615
615
|
def validate_constraints(value: Any, loc: Loc) -> None:
|
|
616
|
+
# An optional field without a value has nothing to check: its type already allowed None.
|
|
617
|
+
if value is None:
|
|
618
|
+
return
|
|
616
619
|
if gt is not None and not value > gt:
|
|
617
620
|
raise _error(loc, f"must be > {gt}", "value_error.number.not_gt")
|
|
618
621
|
if ge is not None and not value >= ge:
|
|
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
|