Skip to content

Commit 801e7a7

Browse files
Allow msgpack (0.6 <= v < 2.0) (#156)
* Update msgpack * Relax msgpack version requirement to avoid breaking change --------- Co-authored-by: James Clark <[email protected]>
1 parent fd482a5 commit 801e7a7

File tree

4 files changed

+14
-10
lines changed

4 files changed

+14
-10
lines changed

VERSION.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.10.0
1+
3.11.0

requirements.txt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,7 @@
33
#
44
# https://github.com/conda-forge/rpcq-feedstock/blob/master/recipe/meta.yaml
55

6-
# msgpack 1.0 introduced breaking changes. See
7-
# https://github.com/rigetti/rpcq/issues/118
8-
msgpack >=0.6,<1.0
6+
msgpack >=0.6,<2.0
97
python-rapidjson
108
pyzmq>=17
119
ruamel.yaml

rpcq/_base.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,8 +173,14 @@ def from_msgpack(b, *, max_bin_len=MAX_BIN_LEN, max_str_len=MAX_STR_LEN):
173173
# Otherwise, unpack to Python str (or unicode on Python 2) by decoding with UTF-8 encoding (recommended).
174174
# In msgpack >= 0.6, max_xxx_len is reduced from 2 GB to 1 MB, so we set the relevant ones
175175
# to 2 GB as to not run into issues with the size of the values returned from rpcq
176-
return msgpack.loads(b, object_hook=_object_hook, raw=False,
177-
max_bin_len=max_bin_len, max_str_len=max_str_len)
176+
return msgpack.loads(
177+
b,
178+
object_hook=_object_hook,
179+
raw=False,
180+
max_bin_len=max_bin_len,
181+
max_str_len=max_str_len,
182+
strict_map_key=False,
183+
)
178184

179185

180186
def to_json(obj):

setup.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,10 @@
5151
long_description=long_description,
5252
long_description_content_type='text/markdown',
5353
install_requires=[
54-
'msgpack>=0.6,<1.0',
55-
'python-rapidjson',
56-
'pyzmq>=17',
57-
'ruamel.yaml',
54+
"msgpack>=0.6,<2.0",
55+
"python-rapidjson",
56+
"pyzmq>=17",
57+
"ruamel.yaml",
5858
],
5959
keywords='quantum rpc qcs',
6060
python_requires='>=3.6',

0 commit comments

Comments
 (0)