modmex 1.2.2__tar.gz → 1.2.4__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: modmex
3
- Version: 1.2.2
3
+ Version: 1.2.4
4
4
  Classifier: Programming Language :: Python :: 3.10
5
5
  Classifier: Programming Language :: Python :: 3.11
6
6
  Classifier: Programming Language :: Python :: 3.12
@@ -527,7 +527,11 @@ class BaseModel(metaclass=BaseModelMeta):
527
527
  type(self).__modmex_serialization_name_map__,
528
528
  )
529
529
  if dump_plan is not None:
530
- return orjson.dumps(dump_plan(self)).decode("utf-8")
530
+ return orjson.dumps(
531
+ dump_plan(self),
532
+ option=orjson.OPT_PASSTHROUGH_DATETIME,
533
+ default=custom_serializer,
534
+ ).decode("utf-8")
531
535
  return orjson.dumps(
532
536
  self.model_dump(
533
537
  exclude=exclude,
@@ -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:
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "modmex"
3
- version = "1.2.2"
3
+ version = "1.2.4"
4
4
  description = "Lightweight Python models built on dataclasses with validation, serialization, and type-safe data mapping"
5
5
  authors = [
6
6
  {name = "clandro89@gmail.com"}
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