soia-client 1.0.5__tar.gz → 1.0.6__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 soia-client might be problematic. Click here for more details.

Files changed (31) hide show
  1. {soia_client-1.0.5 → soia_client-1.0.6}/PKG-INFO +1 -1
  2. {soia_client-1.0.5 → soia_client-1.0.6}/pyproject.toml +1 -1
  3. {soia_client-1.0.5 → soia_client-1.0.6}/soia_client.egg-info/PKG-INFO +1 -1
  4. {soia_client-1.0.5 → soia_client-1.0.6}/soialib/impl/structs.py +13 -1
  5. {soia_client-1.0.5 → soia_client-1.0.6}/tests/test_module_initializer.py +20 -0
  6. {soia_client-1.0.5 → soia_client-1.0.6}/LICENSE +0 -0
  7. {soia_client-1.0.5 → soia_client-1.0.6}/README +0 -0
  8. {soia_client-1.0.5 → soia_client-1.0.6}/setup.cfg +0 -0
  9. {soia_client-1.0.5 → soia_client-1.0.6}/soia_client.egg-info/SOURCES.txt +0 -0
  10. {soia_client-1.0.5 → soia_client-1.0.6}/soia_client.egg-info/dependency_links.txt +0 -0
  11. {soia_client-1.0.5 → soia_client-1.0.6}/soia_client.egg-info/top_level.txt +0 -0
  12. {soia_client-1.0.5 → soia_client-1.0.6}/soialib/__init__.py +0 -0
  13. {soia_client-1.0.5 → soia_client-1.0.6}/soialib/impl/__init__.py +0 -0
  14. {soia_client-1.0.5 → soia_client-1.0.6}/soialib/impl/arrays.py +0 -0
  15. {soia_client-1.0.5 → soia_client-1.0.6}/soialib/impl/encoding.py +0 -0
  16. {soia_client-1.0.5 → soia_client-1.0.6}/soialib/impl/enums.py +0 -0
  17. {soia_client-1.0.5 → soia_client-1.0.6}/soialib/impl/function_maker.py +0 -0
  18. {soia_client-1.0.5 → soia_client-1.0.6}/soialib/impl/optionals.py +0 -0
  19. {soia_client-1.0.5 → soia_client-1.0.6}/soialib/impl/primitives.py +0 -0
  20. {soia_client-1.0.5 → soia_client-1.0.6}/soialib/impl/repr.py +0 -0
  21. {soia_client-1.0.5 → soia_client-1.0.6}/soialib/impl/type_adapter.py +0 -0
  22. {soia_client-1.0.5 → soia_client-1.0.6}/soialib/keyed_items.py +0 -0
  23. {soia_client-1.0.5 → soia_client-1.0.6}/soialib/method.py +0 -0
  24. {soia_client-1.0.5 → soia_client-1.0.6}/soialib/module_initializer.py +0 -0
  25. {soia_client-1.0.5 → soia_client-1.0.6}/soialib/never.py +0 -0
  26. {soia_client-1.0.5 → soia_client-1.0.6}/soialib/serializer.py +0 -0
  27. {soia_client-1.0.5 → soia_client-1.0.6}/soialib/serializers.py +0 -0
  28. {soia_client-1.0.5 → soia_client-1.0.6}/soialib/spec.py +0 -0
  29. {soia_client-1.0.5 → soia_client-1.0.6}/soialib/timestamp.py +0 -0
  30. {soia_client-1.0.5 → soia_client-1.0.6}/tests/test_serializers.py +0 -0
  31. {soia_client-1.0.5 → soia_client-1.0.6}/tests/test_timestamp.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: soia-client
3
- Version: 1.0.5
3
+ Version: 1.0.6
4
4
  Author-email: Tyler Fibonacci <gepheum@gmail.com>
5
5
  License: MIT License
6
6
 
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "soia-client"
7
- version = "1.0.5"
7
+ version = "1.0.6"
8
8
  description = ""
9
9
  readme = "README.md"
10
10
  authors = [{ name = "Tyler Fibonacci", email = "gepheum@gmail.com" }]
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: soia-client
3
- Version: 1.0.5
3
+ Version: 1.0.6
4
4
  Author-email: Tyler Fibonacci <gepheum@gmail.com>
5
5
  License: MIT License
6
6
 
@@ -146,7 +146,7 @@ class StructAdapter(TypeAdapter):
146
146
  )
147
147
 
148
148
  # Initialize DEFAULT.
149
- self.gen_class.DEFAULT.__init__()
149
+ _init_default(self.gen_class.DEFAULT, fields)
150
150
 
151
151
  # Define mutable getters
152
152
  for field in fields:
@@ -674,6 +674,18 @@ def _adjust_array_len_expr(var: str, removed_numbers: tuple[int, ...]) -> str:
674
674
  return ret
675
675
 
676
676
 
677
+ def _init_default(default: Any, fields: Sequence[_Field]) -> None:
678
+ for field in fields:
679
+ attribute = field.field.attribute
680
+ get_field_default = make_function(
681
+ name="get_default",
682
+ params=(),
683
+ body=(Line.join("return ", field.type.default_expr()),),
684
+ )
685
+ object.__setattr__(default, attribute, get_field_default())
686
+ object.__setattr__(default, "_array_len", 0)
687
+
688
+
677
689
  def _make_mutable_getter(field: _Field) -> Callable[[Any], Any]:
678
690
  # Two cases: the field either has struct type or array type.
679
691
  attribute = field.field.attribute
@@ -259,6 +259,26 @@ class ModuleInitializerTestCase(unittest.TestCase):
259
259
  ),
260
260
  ),
261
261
  ),
262
+ spec.Struct(
263
+ id="my/module.soia:RecOuter",
264
+ fields=(
265
+ spec.Field(
266
+ name="r",
267
+ number=0,
268
+ type="my/module.soia:RecOuter.RecInner",
269
+ ),
270
+ ),
271
+ ),
272
+ spec.Struct(
273
+ id="my/module.soia:RecOuter.RecInner",
274
+ fields=(
275
+ spec.Field(
276
+ name="r",
277
+ number=0,
278
+ type="my/module.soia:RecOuter",
279
+ ),
280
+ ),
281
+ ),
262
282
  ),
263
283
  methods=(
264
284
  spec.Method(
File without changes
File without changes
File without changes
File without changes