Skip to content
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 6 commits into from
Aug 29, 2020
Merged

Support msgpack 1.0.0 #173

merged 6 commits into from
Aug 29, 2020

Conversation

Totktonada
Copy link
Member

Fixes #155.
Supersedes PR #156.
Supersedes PR #167.

tarantool/schema.py Outdated Show resolved Hide resolved
@Totktonada Totktonada force-pushed the Totktonada/support-msgpack-1.0.0 branch 2 times, most recently from ce6d483 to 190e1c8 Compare August 28, 2020 16:43
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 Totktonada force-pushed the Totktonada/support-msgpack-1.0.0 branch 2 times, most recently from 7c9d9cb to a02ad89 Compare August 29, 2020 00:27
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 Totktonada force-pushed the Totktonada/support-msgpack-1.0.0 branch from a02ad89 to 053aa88 Compare August 29, 2020 00:33
@Totktonada Totktonada merged commit 148d12e into master Aug 29, 2020
@Totktonada Totktonada deleted the Totktonada/support-msgpack-1.0.0 branch August 29, 2020 02:13
This was referenced Aug 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

New python-msgpack version brokes connector
2 participants