ormsgpack 1.4.0__tar.gz → 1.4.1__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.
Potentially problematic release.
This version of ormsgpack might be problematic. Click here for more details.
- {ormsgpack-1.4.0 → ormsgpack-1.4.1}/CHANGELOG.md +6 -0
- {ormsgpack-1.4.0 → ormsgpack-1.4.1}/Cargo.lock +7 -7
- {ormsgpack-1.4.0 → ormsgpack-1.4.1}/Cargo.toml +2 -2
- {ormsgpack-1.4.0 → ormsgpack-1.4.1}/PKG-INFO +8 -18
- {ormsgpack-1.4.0 → ormsgpack-1.4.1}/README.md +7 -17
- {ormsgpack-1.4.0 → ormsgpack-1.4.1}/src/serialize/dict.rs +5 -3
- {ormsgpack-1.4.0 → ormsgpack-1.4.1}/LICENSE-APACHE +0 -0
- {ormsgpack-1.4.0 → ormsgpack-1.4.1}/LICENSE-MIT +0 -0
- {ormsgpack-1.4.0 → ormsgpack-1.4.1}/build.rs +0 -0
- {ormsgpack-1.4.0 → ormsgpack-1.4.1}/pyproject.toml +0 -0
- {ormsgpack-1.4.0 → ormsgpack-1.4.1}/python/ormsgpack/__init__.py +0 -0
- {ormsgpack-1.4.0 → ormsgpack-1.4.1}/python/ormsgpack/__init__.pyi +0 -0
- {ormsgpack-1.4.0 → ormsgpack-1.4.1}/python/ormsgpack/py.typed +0 -0
- {ormsgpack-1.4.0 → ormsgpack-1.4.1}/src/deserialize/cache.rs +0 -0
- {ormsgpack-1.4.0 → ormsgpack-1.4.1}/src/deserialize/deserializer.rs +0 -0
- {ormsgpack-1.4.0 → ormsgpack-1.4.1}/src/deserialize/error.rs +0 -0
- {ormsgpack-1.4.0 → ormsgpack-1.4.1}/src/deserialize/mod.rs +0 -0
- {ormsgpack-1.4.0 → ormsgpack-1.4.1}/src/exc.rs +0 -0
- {ormsgpack-1.4.0 → ormsgpack-1.4.1}/src/ext.rs +0 -0
- {ormsgpack-1.4.0 → ormsgpack-1.4.1}/src/ffi.rs +0 -0
- {ormsgpack-1.4.0 → ormsgpack-1.4.1}/src/lib.rs +0 -0
- {ormsgpack-1.4.0 → ormsgpack-1.4.1}/src/opt.rs +0 -0
- {ormsgpack-1.4.0 → ormsgpack-1.4.1}/src/serialize/bytes.rs +0 -0
- {ormsgpack-1.4.0 → ormsgpack-1.4.1}/src/serialize/dataclass.rs +0 -0
- {ormsgpack-1.4.0 → ormsgpack-1.4.1}/src/serialize/datetime.rs +0 -0
- {ormsgpack-1.4.0 → ormsgpack-1.4.1}/src/serialize/default.rs +0 -0
- {ormsgpack-1.4.0 → ormsgpack-1.4.1}/src/serialize/ext.rs +0 -0
- {ormsgpack-1.4.0 → ormsgpack-1.4.1}/src/serialize/int.rs +0 -0
- {ormsgpack-1.4.0 → ormsgpack-1.4.1}/src/serialize/list.rs +0 -0
- {ormsgpack-1.4.0 → ormsgpack-1.4.1}/src/serialize/mod.rs +0 -0
- {ormsgpack-1.4.0 → ormsgpack-1.4.1}/src/serialize/numpy.rs +0 -0
- {ormsgpack-1.4.0 → ormsgpack-1.4.1}/src/serialize/serializer.rs +0 -0
- {ormsgpack-1.4.0 → ormsgpack-1.4.1}/src/serialize/str.rs +0 -0
- {ormsgpack-1.4.0 → ormsgpack-1.4.1}/src/serialize/tuple.rs +0 -0
- {ormsgpack-1.4.0 → ormsgpack-1.4.1}/src/serialize/uuid.rs +0 -0
- {ormsgpack-1.4.0 → ormsgpack-1.4.1}/src/serialize/writer.rs +0 -0
- {ormsgpack-1.4.0 → ormsgpack-1.4.1}/src/typeref.rs +0 -0
- {ormsgpack-1.4.0 → ormsgpack-1.4.1}/src/unicode.rs +0 -0
- {ormsgpack-1.4.0 → ormsgpack-1.4.1}/src/util.rs +0 -0
|
@@ -118,7 +118,7 @@ checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d"
|
|
|
118
118
|
|
|
119
119
|
[[package]]
|
|
120
120
|
name = "ormsgpack"
|
|
121
|
-
version = "1.4.
|
|
121
|
+
version = "1.4.1"
|
|
122
122
|
dependencies = [
|
|
123
123
|
"ahash",
|
|
124
124
|
"associative-cache",
|
|
@@ -266,9 +266,9 @@ checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49"
|
|
|
266
266
|
|
|
267
267
|
[[package]]
|
|
268
268
|
name = "serde"
|
|
269
|
-
version = "1.0.
|
|
269
|
+
version = "1.0.192"
|
|
270
270
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
271
|
-
checksum = "
|
|
271
|
+
checksum = "bca2a08484b285dcb282d0f67b26cadc0df8b19f8c12502c13d966bf9482f001"
|
|
272
272
|
dependencies = [
|
|
273
273
|
"serde_derive",
|
|
274
274
|
]
|
|
@@ -284,9 +284,9 @@ dependencies = [
|
|
|
284
284
|
|
|
285
285
|
[[package]]
|
|
286
286
|
name = "serde_derive"
|
|
287
|
-
version = "1.0.
|
|
287
|
+
version = "1.0.192"
|
|
288
288
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
289
|
-
checksum = "
|
|
289
|
+
checksum = "d6c7207fbec9faa48073f3e3074cbe553af6ea512d7c21ba46e434e70ea9fbc1"
|
|
290
290
|
dependencies = [
|
|
291
291
|
"proc-macro2",
|
|
292
292
|
"quote",
|
|
@@ -301,9 +301,9 @@ checksum = "f27f6278552951f1f2b8cf9da965d10969b2efdea95a6ec47987ab46edfe263a"
|
|
|
301
301
|
|
|
302
302
|
[[package]]
|
|
303
303
|
name = "smallvec"
|
|
304
|
-
version = "1.11.
|
|
304
|
+
version = "1.11.2"
|
|
305
305
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
306
|
-
checksum = "
|
|
306
|
+
checksum = "4dccd0940a2dcdf68d092b8cbab7dc0ad8fa938bf95787e1b916b0e3d0e8e970"
|
|
307
307
|
|
|
308
308
|
[[package]]
|
|
309
309
|
name = "syn"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[package]
|
|
2
2
|
name = "ormsgpack"
|
|
3
|
-
version = "1.4.
|
|
3
|
+
version = "1.4.1"
|
|
4
4
|
authors = [
|
|
5
5
|
"Aviram Hassan <aviramyhassan@gmail.com>",
|
|
6
6
|
"Emanuele Giaquinta <emanuele.giaquinta@gmail.com>",
|
|
@@ -49,7 +49,7 @@ rmp-serde = { version = "1", default_features = false }
|
|
|
49
49
|
serde = { version = "1", default_features = false }
|
|
50
50
|
serde_bytes = { version = "0.11.12", default_features = false, features = ["std"] }
|
|
51
51
|
simdutf8 = { version = "0.1", default_features = false, features = ["std", "aarch64_neon"] }
|
|
52
|
-
smallvec = { version = "^1.
|
|
52
|
+
smallvec = { version = "^1.11", default_features = false, features = ["union", "write"] }
|
|
53
53
|
|
|
54
54
|
[build-dependencies]
|
|
55
55
|
pyo3-build-config = { version = "^0.20.0" }
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: ormsgpack
|
|
3
|
-
Version: 1.4.
|
|
3
|
+
Version: 1.4.1
|
|
4
4
|
Classifier: Development Status :: 5 - Production/Stable
|
|
5
5
|
Classifier: Intended Audience :: Developers
|
|
6
6
|
Classifier: License :: OSI Approved :: Apache Software License
|
|
@@ -146,7 +146,7 @@ The global interpreter lock (GIL) is held for the duration of the call.
|
|
|
146
146
|
|
|
147
147
|
It raises `MsgpackEncodeError` on an unsupported type. This exception message
|
|
148
148
|
describes the invalid object with the error message
|
|
149
|
-
`Type is not
|
|
149
|
+
`Type is not msgpack serializable: ...`. To fix this, specify
|
|
150
150
|
[default](#default).
|
|
151
151
|
|
|
152
152
|
It raises `MsgpackEncodeError` on a `str` that contains invalid UTF-8.
|
|
@@ -162,8 +162,7 @@ It raises `MsgpackEncodeError` on circular references.
|
|
|
162
162
|
It raises `MsgpackEncodeError` if a `tzinfo` on a datetime object is
|
|
163
163
|
unsupported.
|
|
164
164
|
|
|
165
|
-
`MsgpackEncodeError` is a subclass of `TypeError`.
|
|
166
|
-
with the standard library.
|
|
165
|
+
`MsgpackEncodeError` is a subclass of `TypeError`.
|
|
167
166
|
|
|
168
167
|
#### default
|
|
169
168
|
|
|
@@ -181,7 +180,7 @@ def default(obj):
|
|
|
181
180
|
raise TypeError
|
|
182
181
|
|
|
183
182
|
>>> ormsgpack.packb(decimal.Decimal("0.0842389659712649442845"))
|
|
184
|
-
MsgpackEncodeError: Type is not
|
|
183
|
+
MsgpackEncodeError: Type is not msgpack serializable: decimal.Decimal
|
|
185
184
|
>>> ormsgpack.packb(decimal.Decimal("0.0842389659712649442845"), default=default)
|
|
186
185
|
b'\xb80.0842389659712649442845'
|
|
187
186
|
>>> ormsgpack.packb({1, 2}, default=default)
|
|
@@ -252,9 +251,7 @@ has no effect on `datetime.datetime` objects that have `tzinfo` set.
|
|
|
252
251
|
|
|
253
252
|
Serialize `dict` keys of type other than `str`. This allows `dict` keys
|
|
254
253
|
to be one of `str`, `int`, `float`, `bool`, `None`, `datetime.datetime`,
|
|
255
|
-
`datetime.date`, `datetime.time`, `enum.Enum`, and `uuid.UUID`.
|
|
256
|
-
the standard library serializes `str`, `int`, `float`, `bool` or `None` by
|
|
257
|
-
default.
|
|
254
|
+
`datetime.date`, `datetime.time`, `enum.Enum`, and `uuid.UUID`.
|
|
258
255
|
|
|
259
256
|
```python
|
|
260
257
|
>>> import ormsgpack, datetime, uuid
|
|
@@ -435,8 +432,7 @@ Serialize `pydantic.BaseModel` instances.
|
|
|
435
432
|
##### OPT_SORT_KEYS
|
|
436
433
|
|
|
437
434
|
Serialize `dict` keys in sorted order. The default is to serialize in an
|
|
438
|
-
unspecified order.
|
|
439
|
-
library.
|
|
435
|
+
unspecified order.
|
|
440
436
|
|
|
441
437
|
This can be used to ensure the order is deterministic for hashing or tests.
|
|
442
438
|
It has a substantial performance penalty and is not recommended in general.
|
|
@@ -457,8 +453,6 @@ The sorting is not collation/locale-aware:
|
|
|
457
453
|
b'\x83\xa1A\x03\xa1a\x01\xa2\xc3\xa4\x02'
|
|
458
454
|
```
|
|
459
455
|
|
|
460
|
-
This is the same sorting behavior as the standard library.
|
|
461
|
-
|
|
462
456
|
`dataclass` also serialize as maps but this has no effect on them.
|
|
463
457
|
|
|
464
458
|
##### OPT_UTC_Z
|
|
@@ -585,7 +579,7 @@ test_dataclass_msgpack 140.2774 (40.96) 143.6087 (18.42) 141.3847 (3
|
|
|
585
579
|
|
|
586
580
|
ormsgpack serializes `datetime.datetime` objects to
|
|
587
581
|
[RFC 3339](https://tools.ietf.org/html/rfc3339) format,
|
|
588
|
-
e.g., "1970-01-01T00:00:00+00:00". This is a subset of ISO 8601 and
|
|
582
|
+
e.g., "1970-01-01T00:00:00+00:00". This is a subset of ISO 8601 and is
|
|
589
583
|
compatible with `isoformat()` in the standard library.
|
|
590
584
|
|
|
591
585
|
```python
|
|
@@ -632,17 +626,13 @@ module, or a timezone instance from the third-party `pendulum`, `pytz`, or
|
|
|
632
626
|
|
|
633
627
|
Errors with `tzinfo` result in `MsgpackEncodeError` being raised.
|
|
634
628
|
|
|
635
|
-
It is faster to have ormsgpack serialize datetime objects than to do so
|
|
636
|
-
before calling `packb()`. If using an unsupported type such as
|
|
637
|
-
`pendulum.datetime`, use `default`.
|
|
638
|
-
|
|
639
629
|
To disable serialization of `datetime` objects specify the option
|
|
640
630
|
`ormsgpack.OPT_PASSTHROUGH_DATETIME`.
|
|
641
631
|
|
|
642
632
|
To use "Z" suffix instead of "+00:00" to indicate UTC ("Zulu") time, use the option
|
|
643
633
|
`ormsgpack.OPT_UTC_Z`.
|
|
644
634
|
|
|
645
|
-
To assume datetimes without timezone are UTC,
|
|
635
|
+
To assume datetimes without timezone are UTC, use the option `ormsgpack.OPT_NAIVE_UTC`.
|
|
646
636
|
|
|
647
637
|
### enum
|
|
648
638
|
|
|
@@ -114,7 +114,7 @@ The global interpreter lock (GIL) is held for the duration of the call.
|
|
|
114
114
|
|
|
115
115
|
It raises `MsgpackEncodeError` on an unsupported type. This exception message
|
|
116
116
|
describes the invalid object with the error message
|
|
117
|
-
`Type is not
|
|
117
|
+
`Type is not msgpack serializable: ...`. To fix this, specify
|
|
118
118
|
[default](#default).
|
|
119
119
|
|
|
120
120
|
It raises `MsgpackEncodeError` on a `str` that contains invalid UTF-8.
|
|
@@ -130,8 +130,7 @@ It raises `MsgpackEncodeError` on circular references.
|
|
|
130
130
|
It raises `MsgpackEncodeError` if a `tzinfo` on a datetime object is
|
|
131
131
|
unsupported.
|
|
132
132
|
|
|
133
|
-
`MsgpackEncodeError` is a subclass of `TypeError`.
|
|
134
|
-
with the standard library.
|
|
133
|
+
`MsgpackEncodeError` is a subclass of `TypeError`.
|
|
135
134
|
|
|
136
135
|
#### default
|
|
137
136
|
|
|
@@ -149,7 +148,7 @@ def default(obj):
|
|
|
149
148
|
raise TypeError
|
|
150
149
|
|
|
151
150
|
>>> ormsgpack.packb(decimal.Decimal("0.0842389659712649442845"))
|
|
152
|
-
MsgpackEncodeError: Type is not
|
|
151
|
+
MsgpackEncodeError: Type is not msgpack serializable: decimal.Decimal
|
|
153
152
|
>>> ormsgpack.packb(decimal.Decimal("0.0842389659712649442845"), default=default)
|
|
154
153
|
b'\xb80.0842389659712649442845'
|
|
155
154
|
>>> ormsgpack.packb({1, 2}, default=default)
|
|
@@ -220,9 +219,7 @@ has no effect on `datetime.datetime` objects that have `tzinfo` set.
|
|
|
220
219
|
|
|
221
220
|
Serialize `dict` keys of type other than `str`. This allows `dict` keys
|
|
222
221
|
to be one of `str`, `int`, `float`, `bool`, `None`, `datetime.datetime`,
|
|
223
|
-
`datetime.date`, `datetime.time`, `enum.Enum`, and `uuid.UUID`.
|
|
224
|
-
the standard library serializes `str`, `int`, `float`, `bool` or `None` by
|
|
225
|
-
default.
|
|
222
|
+
`datetime.date`, `datetime.time`, `enum.Enum`, and `uuid.UUID`.
|
|
226
223
|
|
|
227
224
|
```python
|
|
228
225
|
>>> import ormsgpack, datetime, uuid
|
|
@@ -403,8 +400,7 @@ Serialize `pydantic.BaseModel` instances.
|
|
|
403
400
|
##### OPT_SORT_KEYS
|
|
404
401
|
|
|
405
402
|
Serialize `dict` keys in sorted order. The default is to serialize in an
|
|
406
|
-
unspecified order.
|
|
407
|
-
library.
|
|
403
|
+
unspecified order.
|
|
408
404
|
|
|
409
405
|
This can be used to ensure the order is deterministic for hashing or tests.
|
|
410
406
|
It has a substantial performance penalty and is not recommended in general.
|
|
@@ -425,8 +421,6 @@ The sorting is not collation/locale-aware:
|
|
|
425
421
|
b'\x83\xa1A\x03\xa1a\x01\xa2\xc3\xa4\x02'
|
|
426
422
|
```
|
|
427
423
|
|
|
428
|
-
This is the same sorting behavior as the standard library.
|
|
429
|
-
|
|
430
424
|
`dataclass` also serialize as maps but this has no effect on them.
|
|
431
425
|
|
|
432
426
|
##### OPT_UTC_Z
|
|
@@ -553,7 +547,7 @@ test_dataclass_msgpack 140.2774 (40.96) 143.6087 (18.42) 141.3847 (3
|
|
|
553
547
|
|
|
554
548
|
ormsgpack serializes `datetime.datetime` objects to
|
|
555
549
|
[RFC 3339](https://tools.ietf.org/html/rfc3339) format,
|
|
556
|
-
e.g., "1970-01-01T00:00:00+00:00". This is a subset of ISO 8601 and
|
|
550
|
+
e.g., "1970-01-01T00:00:00+00:00". This is a subset of ISO 8601 and is
|
|
557
551
|
compatible with `isoformat()` in the standard library.
|
|
558
552
|
|
|
559
553
|
```python
|
|
@@ -600,17 +594,13 @@ module, or a timezone instance from the third-party `pendulum`, `pytz`, or
|
|
|
600
594
|
|
|
601
595
|
Errors with `tzinfo` result in `MsgpackEncodeError` being raised.
|
|
602
596
|
|
|
603
|
-
It is faster to have ormsgpack serialize datetime objects than to do so
|
|
604
|
-
before calling `packb()`. If using an unsupported type such as
|
|
605
|
-
`pendulum.datetime`, use `default`.
|
|
606
|
-
|
|
607
597
|
To disable serialization of `datetime` objects specify the option
|
|
608
598
|
`ormsgpack.OPT_PASSTHROUGH_DATETIME`.
|
|
609
599
|
|
|
610
600
|
To use "Z" suffix instead of "+00:00" to indicate UTC ("Zulu") time, use the option
|
|
611
601
|
`ormsgpack.OPT_UTC_Z`.
|
|
612
602
|
|
|
613
|
-
To assume datetimes without timezone are UTC,
|
|
603
|
+
To assume datetimes without timezone are UTC, use the option `ormsgpack.OPT_NAIVE_UTC`.
|
|
614
604
|
|
|
615
605
|
### enum
|
|
616
606
|
|
|
@@ -111,7 +111,8 @@ impl Serialize for Dict {
|
|
|
111
111
|
where
|
|
112
112
|
S: Serializer,
|
|
113
113
|
{
|
|
114
|
-
let
|
|
114
|
+
let len = ffi!(Py_SIZE(self.ptr)) as usize;
|
|
115
|
+
let mut map = serializer.serialize_map(Some(len)).unwrap();
|
|
115
116
|
for (key, value) in PyDictIter::from_pyobject(self.ptr) {
|
|
116
117
|
if unlikely!(!is_type!(ob_type!(key.as_ptr()), STR_TYPE)) {
|
|
117
118
|
err!(KEY_MUST_BE_STR)
|
|
@@ -182,7 +183,7 @@ impl Serialize for DictSortedKey {
|
|
|
182
183
|
|
|
183
184
|
items.sort_unstable_by(|a, b| a.0.cmp(b.0));
|
|
184
185
|
|
|
185
|
-
let mut map = serializer.serialize_map(
|
|
186
|
+
let mut map = serializer.serialize_map(Some(len)).unwrap();
|
|
186
187
|
for (key, val) in items.iter() {
|
|
187
188
|
let pyvalue = PyObjectSerializer::new(
|
|
188
189
|
*val,
|
|
@@ -231,7 +232,8 @@ impl Serialize for DictNonStrKey {
|
|
|
231
232
|
S: Serializer,
|
|
232
233
|
{
|
|
233
234
|
let opts = self.opts & NOT_PASSTHROUGH;
|
|
234
|
-
let
|
|
235
|
+
let len = ffi!(Py_SIZE(self.ptr)) as usize;
|
|
236
|
+
let mut map = serializer.serialize_map(Some(len)).unwrap();
|
|
235
237
|
for (key, value) in PyDictIter::from_pyobject(self.ptr) {
|
|
236
238
|
if is_type!(ob_type!(key.as_ptr()), STR_TYPE) {
|
|
237
239
|
let data = unicode_to_str(key.as_ptr());
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|