This stable-version release includes major updates and enhancements/bug fixes since Jan 2024.
Major updates
-
Python 3.13 support (d655ea0)
-
Introduce
pg.viewsmodule: PyGlove's view sub-system for rendering objects. (b7e1e83) -
Introduce
pg.codingmodule: Utilities for code generation. (a4e5373)- Source code evaluation with permission control. (23ca0c2)
Enhancements
-
New features
-
Object typing
- Support JSON schema conversion through
pg.typing.ValueSpec.to_json_schema. (9018f25) - Support
__future__.annotations. (97d6446, 65c7e52) - Support
Protocolsubclasses. (50d8a38) - Support
ClassVar,Finalandpg.Ref[Type]annotations. (005ec58) - Allow override abstract property through symbolic attribute. (f7390c1)
- Enum fields could extend int/str fields. (aac846b)
pg.typing.Unionpreserves the order of candidates. (590584d)- Enables auto_typing for
pg.patcher. (7b56371) - Frozen fields will be absent from init signature. (e6810a8)
- Better forward reference handling. (a040480)
- Support JSON schema conversion through
-
Object serialization
- Add
pg.open_jsonlandpg.io.open_sequenceAPI for serializing/deserializing sequence data. (825db90) - Add
pg.JSONConvertible.load_types_for_deserializationto allow type override during deserialization. (a600470) - Allow
pg.Refto be serialized. (016992e) pg.from_jsonto supportauto_importargument. (c8431bf)pg.to_jsonto supportforce_dictargument. (328c956)
- Add
-
Object formatting
pg.formatto support recursive structures. (29591ea)pg.Formattable.__str_kwargs__and__repr_kwargs__to control default format arguments. (d5dd3c6)- Frozen fields will not be present during formatting. (e6810a8)
pg.Object.formatto control str/bytes field length viamax_str_lenandmax_bytes_len. ((5b9fba4)[https://github.com/google/pyglove/commit/5b9fba467e9f582e6110dce74a08cfc510290206])pg.formatto supportcustom_formatargument. (a78a78e)pg.Formattableto control whether to applymarkdownquotes. (c97818d)
-
Object reference
- Add
pg.derefto dereference a symbolic tree. ((120e924)[https://github.com/google/pyglove/commit/120e924aaad461b766aff0bf65702c3c1fd9776e])
- Add
-
Object mutations
pg.evolveto support mutations on root element. (cc456b1)
-
Utilities
Bug fixes
- Fix serialization of
pg.Objectwith child dict of non-standard keys. (0adebc9) pg.Object: Inherit symbolic attributes from base even when it's overridden as properties. (aad25de)pg.typing.ForwardRefno longer cache resolved class, which allows module reloading. (a92e69e)