-
Notifications
You must be signed in to change notification settings - Fork 118
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
Fix #88: conform to 'new' pyuv API #240
Conversation
Thanks. Just to be clear, are you on windows? If I'm reading things correctly, pyuv is only required there. Else python-client uses asyncio (or trollius for python 2.6). If all that's correct, perhaps we should also specify a minimum pyuv version in setup.py |
No, I'm on linux. |
args=argv, | ||
exit_callback=self._on_exit, | ||
flags=pyuv.UV_PROCESS_WINDOWS_HIDE, | ||
stdio=(stdin, stdout, stderr,)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since pyuv isn't a required dependency we can't really specify the version (except for Windows).
We could check if spawn()
is a class method:
inspect.ismethod(pyuv.Process.spawn) and pyuv.Process.spawn.__self__ is pyuv.Process
and use that as part of the decision here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, so we should require versions newer than 1.0 on Windows.
About Linux, what is your idea? Support both API versions?
I think we should just raise an exception or, ignore pyuv and use asyncio, if pyuv is < 1.0.0.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, we don't need to do it in this PR, but I noticed that here we choose asyncio or pyuv. So as part of that choice, check the API as described in my above comment: if pyuv.Process.spawn
is not an instance method, then we known we have pyuv >= 1.x, and we choose EventLoop = UvEventLoop
. Else, choose EventLoop = AsyncioEventLoop
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I can get back at it monday.
It couldn't hurt to specify a minimum pyuv version in setup.py, and also add diff --git a/setup.py b/setup.py
index f3837036f269..e89bcbea8b6b 100644
--- a/setup.py
+++ b/setup.py
@@ -8,8 +8,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')
@@ -29,4 +33,5 @@ setup(name='neovim',
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) |
Nice, will update the PR. |
Now it's possible to: `pip install neovim[pyuv]`
This solves issue #88.
According to the pyuv releases the API changed in version 1.0.0 in Dec 2, 2014.