tmsgpack 0.2.2__tar.gz → 0.2.3__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.
@@ -0,0 +1 @@
1
+ 0.2.3
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: tmsgpack
3
- Version: 0.2.2
3
+ Version: 0.2.3
4
4
  Summary: Typed MessagePack serializer (inspired by but different from msgpack)
5
5
  Home-page: https://github.com/Yaakov-Belch/tmsgpack
6
6
  Author: Yaakov Belch
@@ -1,6 +1,6 @@
1
1
  [metadata]
2
2
  name = tmsgpack
3
- version = 0.2.2
3
+ version = file: Automatic-Version
4
4
  license = MIT
5
5
  author = Yaakov Belch
6
6
  author_email = yaakov.belch@gmail.com
@@ -0,0 +1,14 @@
1
+ """tmsgpack - Typed MessagePack serializer"""
2
+
3
+ from .cython.tmsgpack import __version__
4
+ from .cython.tmsgpack import EncodeBuffer, DecodeBuffer
5
+ from .cython.tmsgpack import ebuf_put_value, dbuf_take_value
6
+ from .cython.tmsgpack import TMsgpackEncodingError, TMsgpackDecodingError
7
+ from .cython.api import EncodeDecode, BasicCodec, basic_codec
8
+ __all__ = [
9
+ 'EncodeDecode', 'basic_codec', 'BasicCodec',
10
+ 'EncodeBuffer', 'DecodeBuffer',
11
+ 'ebuf_put_value', 'dbuf_take_value',
12
+ 'TMsgpackEncodingError', 'TMsgpackDecodingError',
13
+ ]
14
+
@@ -2,6 +2,7 @@ from typing import Any, Tuple
2
2
  from dataclasses import dataclass
3
3
  from tmsgpack.cython.tmsgpack import EncodeBuffer, DecodeBuffer
4
4
  from tmsgpack.cython.tmsgpack import ebuf_put_value, dbuf_take_value
5
+ from tmsgpack.cython.tmsgpack import TMsgpackEncodingError, TMsgpackDecodingError
5
6
 
6
7
  class EncodeDecode:
7
8
  def encode(self, value, target=None):
@@ -33,8 +34,8 @@ class BasicCodec(EncodeDecode):
33
34
  if codec_type is None: return self
34
35
  raise TMsgpackDecodingError(f'Unsupported codec_type: {codec_type}')
35
36
 
36
- def decompose_value(self, value):
37
- raise TMsgpackEncodingError(f'Unsupported value: {value}')
37
+ def decompose_value(self, ectx):
38
+ raise TMsgpackEncodingError(f'Unsupported value: {ectx.value}')
38
39
 
39
40
  def value_from_bytes(self, obj_type, data: bytes):
40
41
  raise TMsgpackDecodingError(f'No bytes extension defined: {obj_type=} {data=}')