-
Notifications
You must be signed in to change notification settings - Fork 46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support msgpack 1.0.0 #173
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
artembo
reviewed
Aug 26, 2020
Totktonada
force-pushed
the
Totktonada/support-msgpack-1.0.0
branch
2 times, most recently
from
August 28, 2020 16:43
ce6d483
to
190e1c8
Compare
We will need a bit more logic in unpacker configuration code to support msgpack-1.0.0, so it is convenient to factor out it from actual creation of the unpacker instance. No behaviour is changed here. Part of #155
msgpack-1.0.0 changes default value of 'raw' and 'strict_map_key' options. We should handle different versions of the library and provide the same behaviour across them. This version of the msgpack library also drops support of 'encoding' option. We already use raw=True/False msgpack option to implement encoding=None/'utf-8' connector option, so the only change we should do about this is to explicitly forbid other encoding values. Unlikely using of text encodings other than UTF-8 is popular. Part of #155
We'll need to tune msgpack options in order to support msgpack-1.0.0 and it is convenient to do so in one place. Aside of this, reusing of an msgpack.Packer() instance looks good for performance matters, however I guess that an actual difference is negligible. No behaviour is changed. Part of #155
The default value of the 'use_bin_type' option was changed in msgpack-1.0.0. We should support different versions of the library and provide the same behaviour across them. Aside of this, 'encoding' option was dropped since this version of the msgpack library, but we didn't actually support it for packing. Binary strings are packed as is (as mp_str), Unicode strings are encoded as UTF-8 (as mp_str too) and nothing is changed regarding this. Fixes #155
When 'use_bin_type' option is not set explicitly, msgpack-0.5.0 (and only it, not 0.5.1 or newer) warns a user that its default value will be changed in a future. The main reason of the change is to allow test_03_discovery_bad_good_addresses() test from test_mesh.py to pass on msgpack-0.5.0: it counts deprecation warnings produced by a call and so affected if unexpected warnings are emitted. This commit is prerequisite to enable msgpack-0.5.0 in CI, which is done in the next commit. Follows up #155
Totktonada
force-pushed
the
Totktonada/support-msgpack-1.0.0
branch
2 times, most recently
from
August 29, 2020 00:27
7c9d9cb
to
a02ad89
Compare
Also bump msgpack PyPI package name in requirements.txt. See the note about the library name change in [1]: | Package name on PyPI was changed to msgpack from 0.5. I choose versions for testing this way: we have 0.4.0 in requirements.txt, so it is the baseline. We should test at least 0.4.0, 0.5.0, 0.6.0 and 1.0.0. I also added 0.6.2, because this version is installed on my Gentoo box and because it is the last release before 1.0.0. [1]: https://github.com/msgpack/msgpack-python/blob/8fb709f2e0438862020d8810fa70a81fb5dac7d4/README.md Follows up #155
Totktonada
force-pushed
the
Totktonada/support-msgpack-1.0.0
branch
from
August 29, 2020 00:33
a02ad89
to
053aa88
Compare
This was referenced Aug 29, 2020
Closed
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #155.
Supersedes PR #156.
Supersedes PR #167.