Skip to content

Commit

Permalink
hamster wheel: avoid deprecated "encoding" msgpack param
Browse files Browse the repository at this point in the history
"encoding" was deprecated in msgpack module.

raw_as_bytes was added in 0.5.2 and is recommended going forward,
but it's not clear to me if we have any reason to specify it.

ref msgpack/msgpack-python@5534d0c#diff-88b99bb28683bd5b7e3a204826ead112R40
  • Loading branch information
justinmk committed Nov 18, 2018
1 parent 8a6bfa2 commit c771bfd
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 12 deletions.
24 changes: 17 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,23 @@ See the [Python Plugin API](http://pynvim.readthedocs.io/en/latest/usage/python-

#### Development

If you change the code, you need to run
```sh
pip2 install .
pip3 install .
```
for the changes to have effect. For instructions of testing and troubleshooting,
see the [development](http://pynvim.readthedocs.io/en/latest/development.html) documentation.
Use (and activate) a local virtualenv.

python3 -m venv env36
source env36/bin/activate

If you change the code, you must reinstall for the changes to take effect:

pip install .

Use `pytest` to run the tests. Invoking with `python -m` prepends the current
directory to `sys.path` (otherwise `pytest` might find other versions!):

python -m pytest

For details about testing and troubleshooting, see the
[development](http://pynvim.readthedocs.io/en/latest/development.html)
documentation.

#### Usage through the python REPL

Expand Down
8 changes: 5 additions & 3 deletions docs/development.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,11 @@ in order for Neovim to use it for the plugin host.

To run the tests execute::

pytest
python -m pytest

This will run the tests in an embedded instance of Neovim, with the current
directory added to ``sys.path``.

This will run the tests in an embedded instance of Neovim.
If you want to test a different version than ``nvim`` in ``$PATH`` use::

NVIM_CHILD_ARGV='["/path/to/nvim", "-u", "NONE", "--embed"]' pytest
Expand All @@ -30,7 +32,7 @@ Alternatively, if you want to see the state of nvim, you could use::

export NVIM_LISTEN_ADDRESS=/tmp/nvimtest
xterm -e "nvim -u NONE"&
pytest
python -m pytest

But note you need to restart Neovim every time you run the tests!
Substitute your favorite terminal emulator for ``xterm``.
Expand Down
3 changes: 1 addition & 2 deletions pynvim/msgpack_rpc/msgpack_stream.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ class MsgpackStream(object):
def __init__(self, event_loop):
"""Wrap `event_loop` on a msgpack-aware interface."""
self.loop = event_loop
self._packer = Packer(encoding='utf-8',
unicode_errors=unicode_errors_default)
self._packer = Packer(unicode_errors=unicode_errors_default)
self._unpacker = Unpacker()
self._message_cb = None

Expand Down

0 comments on commit c771bfd

Please sign in to comment.