tsrkit-types 0.1.7__py3-none-any.whl → 0.1.8__py3-none-any.whl
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.
- tsrkit_types/integers.py +3 -3
- {tsrkit_types-0.1.7.dist-info → tsrkit_types-0.1.8.dist-info}/METADATA +15 -1
- {tsrkit_types-0.1.7.dist-info → tsrkit_types-0.1.8.dist-info}/RECORD +6 -6
- {tsrkit_types-0.1.7.dist-info → tsrkit_types-0.1.8.dist-info}/WHEEL +0 -0
- {tsrkit_types-0.1.7.dist-info → tsrkit_types-0.1.8.dist-info}/licenses/LICENSE +0 -0
- {tsrkit_types-0.1.7.dist-info → tsrkit_types-0.1.8.dist-info}/top_level.txt +0 -0
tsrkit_types/integers.py
CHANGED
|
@@ -80,13 +80,13 @@ class Int(int, Codable, metaclass=IntCheckMeta):
|
|
|
80
80
|
def __new__(cls, value: Any):
|
|
81
81
|
value = int(value)
|
|
82
82
|
if cls.byte_size > 0:
|
|
83
|
-
max_v = cls._bound // 2 if cls.signed else cls._bound
|
|
83
|
+
max_v = (cls._bound // 2 if cls.signed else cls._bound) - 1
|
|
84
84
|
min_v = -1 * cls._bound // 2 if cls.signed else 0
|
|
85
85
|
else:
|
|
86
86
|
min_v = -1 * cls._bound // 2 if cls.signed else 0
|
|
87
|
-
max_v = cls._bound // 2 if cls.signed else cls._bound - 1
|
|
87
|
+
max_v = (cls._bound // 2 if cls.signed else cls._bound) - 1
|
|
88
88
|
|
|
89
|
-
if not (min_v <= value
|
|
89
|
+
if not (min_v <= value <= max_v):
|
|
90
90
|
raise ValueError(f"Int: {cls.__name__} out of range: {value!r} "
|
|
91
91
|
f"not in [{min_v}, {max_v}]")
|
|
92
92
|
return super().__new__(cls, value)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: tsrkit-types
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.8
|
|
4
4
|
Summary: Performant Python Typings library for type-safe binary serialization, JSON encoding, and data validation with zero dependencies
|
|
5
5
|
Author-email: chainscore-labs <hello@chainscore.finance>, prasad-kumkar <prasad@chainscore.finance>
|
|
6
6
|
License-Expression: MIT
|
|
@@ -794,6 +794,20 @@ pytest -v
|
|
|
794
794
|
pytest -m "not slow"
|
|
795
795
|
```
|
|
796
796
|
|
|
797
|
+
### Build and Publish
|
|
798
|
+
|
|
799
|
+
1. Build the package:
|
|
800
|
+
|
|
801
|
+
```bash
|
|
802
|
+
python3 -m build --wheel
|
|
803
|
+
```
|
|
804
|
+
|
|
805
|
+
2. Publish the wheels:
|
|
806
|
+
|
|
807
|
+
```bash
|
|
808
|
+
twine upload dist/*
|
|
809
|
+
```
|
|
810
|
+
|
|
797
811
|
### Test Coverage
|
|
798
812
|
|
|
799
813
|
View the test coverage report:
|
|
@@ -7,15 +7,15 @@ tsrkit_types/bytes_common.py,sha256=b1Zqh_NhkCX718QaZC52J3nEzKAi1Fe8E0nefWVwwmo,
|
|
|
7
7
|
tsrkit_types/choice.py,sha256=OVHxIr2PcnaTpo5sAMjipCArc5oATNsyYkqZNRqU7bA,5253
|
|
8
8
|
tsrkit_types/dictionary.py,sha256=GcUvaHC1VOEc3OzUVAH0id--ncLqTJ6ZRz-lucMNRdY,5618
|
|
9
9
|
tsrkit_types/enum.py,sha256=3MyLW15_ToQQdctJjcMY8Xb3OsS_Ad997OOEo8FjVeA,4256
|
|
10
|
-
tsrkit_types/integers.py,sha256=
|
|
10
|
+
tsrkit_types/integers.py,sha256=Xu9hjGQWW_NP08QIhKSvlxTeA3UmKsQC1A3NatgILQo,8867
|
|
11
11
|
tsrkit_types/null.py,sha256=vzobz4-xJrUeky8pzbg-Qmz4N6b7GsCNf8TafbstlgY,1372
|
|
12
12
|
tsrkit_types/option.py,sha256=xwtaAFN20GjaGqzYZAAo1fZqqUZnCYHdy2bjshhY620,1631
|
|
13
13
|
tsrkit_types/sequences.py,sha256=KOT5-4mia5Lc0CMjIF7Yqe34Sei92ZQ2s6GaP13soUg,8090
|
|
14
14
|
tsrkit_types/string.py,sha256=8rvg0BwvyhQnbMW3qornmBFTQHeTQFUfwD7OC0eVgcY,2575
|
|
15
15
|
tsrkit_types/struct.py,sha256=GoXWFc1OqO9CXnxFS7Xkms7J-rtZe8h32LkAIBlzdSM,3497
|
|
16
16
|
tsrkit_types/itf/codable.py,sha256=agx8YSVWGBeEiLrU9eqh3ZoeTgpJsmmIlW622xIKqPI,2810
|
|
17
|
-
tsrkit_types-0.1.
|
|
18
|
-
tsrkit_types-0.1.
|
|
19
|
-
tsrkit_types-0.1.
|
|
20
|
-
tsrkit_types-0.1.
|
|
21
|
-
tsrkit_types-0.1.
|
|
17
|
+
tsrkit_types-0.1.8.dist-info/licenses/LICENSE,sha256=TwnDvVCPwHadHWLUuY1sPx03XNw1jzh_ZmoDBNai9Uc,1072
|
|
18
|
+
tsrkit_types-0.1.8.dist-info/METADATA,sha256=XcMJiwod5CkNHpwSSrMTOvRZxMMpv9FEDhi_AS7IYPU,22896
|
|
19
|
+
tsrkit_types-0.1.8.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
20
|
+
tsrkit_types-0.1.8.dist-info/top_level.txt,sha256=pnVhnUsnZ_A0FIj1zHwDw3suMGrfMJwusp-4GPVY1CM,13
|
|
21
|
+
tsrkit_types-0.1.8.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|