tmsgpack 0.2.2__tar.gz → 0.2.7__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.7
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: tmsgpack
3
- Version: 0.2.2
3
+ Version: 0.2.7
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
@@ -3,7 +3,7 @@ from Cython.Build import cythonize
3
3
  import glob
4
4
 
5
5
  # Automatically find all .pyx files in src/
6
- pyx_files = glob.glob("tmsgpack/cython/*.pyx")
6
+ pyx_files = glob.glob("tmsgpack/*.pyx")
7
7
 
8
8
  print("Found packages:", find_packages())
9
9
 
@@ -0,0 +1,14 @@
1
+ """tmsgpack - Typed MessagePack serializer"""
2
+
3
+ from .cython import __version__
4
+ from .cython import EncodeBuffer, DecodeBuffer
5
+ from .cython import ebuf_put_value, dbuf_take_value
6
+ from .cython import TMsgpackEncodingError, TMsgpackDecodingError
7
+ from .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
+
@@ -1,7 +1,8 @@
1
1
  from typing import Any, Tuple
2
2
  from dataclasses import dataclass
3
- from tmsgpack.cython.tmsgpack import EncodeBuffer, DecodeBuffer
4
- from tmsgpack.cython.tmsgpack import ebuf_put_value, dbuf_take_value
3
+ from tmsgpack.cython import EncodeBuffer, DecodeBuffer
4
+ from tmsgpack.cython import ebuf_put_value, dbuf_take_value
5
+ from tmsgpack.cython 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=}')