Skip to content

Commit

Permalink
refactor!: completely wipe out pyuv
Browse files Browse the repository at this point in the history
pynvim has been using asyncio as the only available event loop
implementation, since python 3.4. Remove all the pyuv-related codes
  • Loading branch information
wookayin committed Oct 16, 2023
1 parent 71d2d65 commit a1347ee
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 137 deletions.
2 changes: 1 addition & 1 deletion pynvim/msgpack_rpc/event_loop/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""Event loop abstraction subpackage.
Tries to use pyuv as a backend, falling back to the asyncio implementation.
We use python's built-in asyncio as the backend.
"""

from pynvim.msgpack_rpc.event_loop.asyncio import AsyncioEventLoop as EventLoop
Expand Down
13 changes: 3 additions & 10 deletions pynvim/msgpack_rpc/event_loop/asyncio.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,4 @@
"""Event loop implementation that uses the `asyncio` standard module.
The `asyncio` module was added to python standard library on 3.4, and it
provides a pure python implementation of an event loop library. It is used
as a fallback in case pyuv is not available(on python implementations other
than CPython).
"""
from __future__ import absolute_import
"""Event loop implementation that uses the `asyncio` standard module."""

import asyncio
import logging
Expand All @@ -22,9 +14,10 @@
debug, info, warn = (logger.debug, logger.info, logger.warning,)

loop_cls = asyncio.SelectorEventLoop

if os.name == 'nt':
import msvcrt # pylint: disable=import-error
from asyncio.windows_utils import PipeHandle # type: ignore[attr-defined]
import msvcrt

# On windows use ProactorEventLoop which support pipes and is backed by the
# more powerful IOCP facility
Expand Down
4 changes: 4 additions & 0 deletions pynvim/msgpack_rpc/event_loop/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@
Literal['child']
]

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


class BaseEventLoop(ABC):

Expand Down
124 changes: 0 additions & 124 deletions pynvim/msgpack_rpc/event_loop/uv.py

This file was deleted.

1 change: 0 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
]

extras_require = {
'pyuv': ['pyuv>=1.0.0'],
'test': tests_require,
}

Expand Down
1 change: 0 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ extras = test
deps =
pytest-timeout
# cov: pytest-cov
# pyuv: pyuv
# setenv =
# cov: PYTEST_ADDOPTS=--cov=. {env:PYTEST_ADDOPTS:}
# passenv = PYTEST_ADDOPTS
Expand Down

0 comments on commit a1347ee

Please sign in to comment.