Skip to content

Commit a1347ee

Browse files
committed
refactor!: completely wipe out pyuv
pynvim has been using asyncio as the only available event loop implementation, since python 3.4. Remove all the pyuv-related codes
1 parent 71d2d65 commit a1347ee

File tree

6 files changed

+8
-137
lines changed

6 files changed

+8
-137
lines changed

pynvim/msgpack_rpc/event_loop/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"""Event loop abstraction subpackage.
22
3-
Tries to use pyuv as a backend, falling back to the asyncio implementation.
3+
We use python's built-in asyncio as the backend.
44
"""
55

66
from pynvim.msgpack_rpc.event_loop.asyncio import AsyncioEventLoop as EventLoop

pynvim/msgpack_rpc/event_loop/asyncio.py

+3-10
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,4 @@
1-
"""Event loop implementation that uses the `asyncio` standard module.
2-
3-
The `asyncio` module was added to python standard library on 3.4, and it
4-
provides a pure python implementation of an event loop library. It is used
5-
as a fallback in case pyuv is not available(on python implementations other
6-
than CPython).
7-
8-
"""
9-
from __future__ import absolute_import
1+
"""Event loop implementation that uses the `asyncio` standard module."""
102

113
import asyncio
124
import logging
@@ -22,9 +14,10 @@
2214
debug, info, warn = (logger.debug, logger.info, logger.warning,)
2315

2416
loop_cls = asyncio.SelectorEventLoop
17+
2518
if os.name == 'nt':
19+
import msvcrt # pylint: disable=import-error
2620
from asyncio.windows_utils import PipeHandle # type: ignore[attr-defined]
27-
import msvcrt
2821

2922
# On windows use ProactorEventLoop which support pipes and is backed by the
3023
# more powerful IOCP facility

pynvim/msgpack_rpc/event_loop/base.py

+4
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@
2828
Literal['child']
2929
]
3030

31+
# TODO: Since pynvim now supports python 3, the only available backend of the
32+
# msgpack_rpc BaseEventLoop is the built-in asyncio (see #294). We will have
33+
# to remove some unnecessary abstractions as well as greenlet. See also #489
34+
3135

3236
class BaseEventLoop(ABC):
3337

pynvim/msgpack_rpc/event_loop/uv.py

-124
This file was deleted.

setup.py

-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
]
2424

2525
extras_require = {
26-
'pyuv': ['pyuv>=1.0.0'],
2726
'test': tests_require,
2827
}
2928

tox.ini

-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ extras = test
2525
deps =
2626
pytest-timeout
2727
# cov: pytest-cov
28-
# pyuv: pyuv
2928
# setenv =
3029
# cov: PYTEST_ADDOPTS=--cov=. {env:PYTEST_ADDOPTS:}
3130
# passenv = PYTEST_ADDOPTS

0 commit comments

Comments
 (0)