Skip to content

Releases: timrid/construct-typing

v0.6.2

03 Aug 07:30
Compare
Choose a tag to compare
  • fixed error message from EnumBase and FlagsEnumBase that occures since pyright v1.1.320
  • removed unnessasary __new__ methods in DataclassStruct, TEnum and TFlagsEnum

v0.6.1

24 Jul 09:56
Compare
Choose a tag to compare

fixed missmatch between stub and runtime type for Array

v0.6.0

24 Jul 09:15
Compare
Choose a tag to compare
  • Reworked construct-stubs so that it supports pyright>=v1.1.310. To support pyright and mypy in the past, __new__ and __init__ had to be defined. However, this is no longer supported by pyright. Now in most cases only __init__ is defined. Only for some special cases __new__ is used (e.g. for FormatField, Const, Hex, HexDump, IfThenElse, Switch)
  • Added stubs for cs.Compiled.
  • Added some more missing definitions (__author__, __version__, possiblestringencodings, hexdump, hexundump, PY)
  • Use PEP688 buffer protocol for the parse method (fixes #24). This requires a dependency to typing_extensions>=4.6.0.
  • build_stream and build_file do not return anything (fixes #25).

v0.5.6

09 May 11:05
Compare
Choose a tag to compare
  • Fixed python 3.11 error when using dataclasses.asdict for dataclasses that contains an EnumBase instance. (fixes #21)
  • Changed BinaryIO to IO[bytes] as StreamType. (fixes #19)

v0.5.5

09 Jan 14:21
Compare
Choose a tag to compare
  • added type hints for cs.Struct._subcons, cs.Sequence._subcons, cs.FocusedSeq._subcons, cs.Union._subcons, cs.LazyStruct._subcons, cs.LazyStruct._subconsindexes
  • added generic wrapper for cs.Array
  • added __init__ methods for all constructs that currently only define an __new__ method
  • using __new__ instead of __init__ for EnumBase to create enum member objects (fixes #18)

v0.5.4

24 Dec 11:22
Compare
Choose a tag to compare
  • fixed static analysis issues so that the latest versions are supported
    • pyright: 1.1.285
    • mypy: 0.991
  • updated IfThenElse so that it represents the real implementation as a class and not a method
  • enhanced EnumBase and FlagsEnumBase to support individual documentation for each enum value via EnumValue

v0.5.3

31 Oct 09:12
Compare
Choose a tag to compare
  • added python 3.11 support
  • fixed static analysis issues so that the latest versions are supported
    • pyright: 1.1.277
    • mypy: 0.982
  • Use os.PathLike for file names
  • fixed BuildTypes of construct.Const
  • upgrade requirement to construct==2.10.68

v0.5.2

23 Oct 11:11
Compare
Choose a tag to compare
  • fixed setup.py for sdist (.tar.gz file)
  • added stub for evaluate()
  • fixed Switch.default
  • fixed IfThenElse for pyright

v0.5.1

19 Jul 18:53
Compare
Choose a tag to compare

Enhancement for cs.Checksum, so that bytesfunc can return any object and not only bytes.

v0.5.0

24 May 12:58
Compare
Choose a tag to compare

Big changes:

  • renamed classes/methods/files:
    • tstruct.py -> dataclass_struct.py
    • TStruct -> DataclassStruct
    • TBitStruct -> DataclassBitStruct
    • sfield -> csfield
    • TContainerMixin -> DataclassMixin
  • Removed add_offsets from DataclassStruct
  • Revised DataclassMixin:
    • removed inheritance of cs.Container, which removed the inherited methods names like update, keys, etc and makes them usable as dataclass field names
    • copied __str__ from cs.Container with a few modifications, so that the output stays almost the same

Small changes:

  • adapted stubs to construct v2.10.67
  • fixed some errors in construct-stubs and added a few missing methods
  • pyright is now fully supported
  • extended documentation
  • removed unfinished union file