Skip to content

Commit

Permalink
event_loop/uv.py: Conform to pyuv 1.0 API (#240)
Browse files Browse the repository at this point in the history
Closes #88

* Specify minimum pyuv version where possible.
* Add extras_require for pyuv. `pip install neovim[pyuv]`
  • Loading branch information
heliomeiralins authored and justinmk committed Jan 8, 2017
1 parent 549f721 commit 171d137
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
11 changes: 5 additions & 6 deletions neovim/msgpack_rpc/event_loop/uv.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,11 @@ def _connect_child(self, argv):
flags=pyuv.UV_CREATE_PIPE + pyuv.UV_WRITABLE_PIPE)
stderr = pyuv.StdIO(self._error_stream,
flags=pyuv.UV_CREATE_PIPE + pyuv.UV_WRITABLE_PIPE)
self._process = pyuv.Process(self._loop)
self._process.spawn(file=argv[0],
exit_callback=self._on_exit,
args=argv[1:],
flags=pyuv.UV_PROCESS_WINDOWS_HIDE,
stdio=(stdin, stdout, stderr,))
pyuv.Process.spawn(self._loop,
args=argv,
exit_callback=self._on_exit,
flags=pyuv.UV_PROCESS_WINDOWS_HIDE,
stdio=(stdin, stdout, stderr,))
self._error_stream.start_read(self._on_read)

def _start_reading(self):
Expand Down
6 changes: 5 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,12 @@
install_requires = [
'msgpack-python>=0.4.0',
]
extras_require = {
'pyuv': ['pyuv>=1.0.0'],
}

if os.name == 'nt':
install_requires.append('pyuv')
install_requires.append('pyuv>=1.0.0')
elif sys.version_info < (3, 4):
# trollius is just a backport of 3.4 asyncio module
install_requires.append('trollius')
Expand All @@ -29,4 +32,5 @@
packages=['neovim', 'neovim.api', 'neovim.msgpack_rpc',
'neovim.msgpack_rpc.event_loop', 'neovim.plugin'],
install_requires=install_requires,
extras_require=extras_require,
zip_safe=False)

0 comments on commit 171d137

Please sign in to comment.