Skip to content

Commit

Permalink
Allow msgpack (0.6 <= v < 2.0) (#156)
Browse files Browse the repository at this point in the history
* Update msgpack

* Relax msgpack version requirement to avoid breaking change

---------

Co-authored-by: James Clark <james.clark@zapatacomputing.com>
  • Loading branch information
kalzoo and jamesclark-Zapata committed Mar 23, 2023
1 parent fd482a5 commit 801e7a7
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 10 deletions.
2 changes: 1 addition & 1 deletion VERSION.txt
@@ -1 +1 @@
3.10.0
3.11.0
4 changes: 1 addition & 3 deletions requirements.txt
Expand Up @@ -3,9 +3,7 @@
#
# https://github.com/conda-forge/rpcq-feedstock/blob/master/recipe/meta.yaml

# msgpack 1.0 introduced breaking changes. See
# https://github.com/rigetti/rpcq/issues/118
msgpack >=0.6,<1.0
msgpack >=0.6,<2.0
python-rapidjson
pyzmq>=17
ruamel.yaml
Expand Down
10 changes: 8 additions & 2 deletions rpcq/_base.py
Expand Up @@ -173,8 +173,14 @@ def from_msgpack(b, *, max_bin_len=MAX_BIN_LEN, max_str_len=MAX_STR_LEN):
# Otherwise, unpack to Python str (or unicode on Python 2) by decoding with UTF-8 encoding (recommended).
# In msgpack >= 0.6, max_xxx_len is reduced from 2 GB to 1 MB, so we set the relevant ones
# to 2 GB as to not run into issues with the size of the values returned from rpcq
return msgpack.loads(b, object_hook=_object_hook, raw=False,
max_bin_len=max_bin_len, max_str_len=max_str_len)
return msgpack.loads(
b,
object_hook=_object_hook,
raw=False,
max_bin_len=max_bin_len,
max_str_len=max_str_len,
strict_map_key=False,
)


def to_json(obj):
Expand Down
8 changes: 4 additions & 4 deletions setup.py
Expand Up @@ -51,10 +51,10 @@
long_description=long_description,
long_description_content_type='text/markdown',
install_requires=[
'msgpack>=0.6,<1.0',
'python-rapidjson',
'pyzmq>=17',
'ruamel.yaml',
"msgpack>=0.6,<2.0",
"python-rapidjson",
"pyzmq>=17",
"ruamel.yaml",
],
keywords='quantum rpc qcs',
python_requires='>=3.6',
Expand Down

0 comments on commit 801e7a7

Please sign in to comment.