Skip to content

Commit 1197144

Browse files
Drop implicit uvloop support.
Related issues: #2051.
1 parent 054c2f3 commit 1197144

File tree

2 files changed

+0
-35
lines changed

2 files changed

+0
-35
lines changed

mypy.ini

-4
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,3 @@ ignore_missing_imports = True
1414

1515
[mypy-ipywidgets.*]
1616
ignore_missing_imports = True
17-
18-
[mypy-uvloop.*]
19-
# Ignore missing imports for optional library that isn't listed as a dependency.
20-
ignore_missing_imports = True

src/textual/app.py

-31
Original file line numberDiff line numberDiff line change
@@ -295,11 +295,6 @@ def __init__(
295295
css_path: CSSPathType | None = None,
296296
watch_css: bool = False,
297297
):
298-
# N.B. This must be done *before* we call the parent constructor, because MessagePump's
299-
# constructor instantiates a `asyncio.PriorityQueue` and in Python versions older than 3.10
300-
# this will create some first references to an asyncio loop.
301-
_init_uvloop()
302-
303298
super().__init__()
304299
self.features: frozenset[FeatureFlag] = parse_features(os.getenv("TEXTUAL", ""))
305300

@@ -2415,29 +2410,3 @@ def _begin_update(self) -> None:
24152410
def _end_update(self) -> None:
24162411
if self._sync_available:
24172412
self.console.file.write(SYNC_END)
2418-
2419-
2420-
_uvloop_init_done: bool = False
2421-
2422-
2423-
def _init_uvloop() -> None:
2424-
"""Import and install the `uvloop` asyncio policy, if available.
2425-
2426-
This is done only once, even if the function is called multiple times.
2427-
2428-
This is provided as a nicety for users that have `uvloop` installed independently
2429-
of Textual, as `uvloop` is not listed as a Textual dependency.
2430-
"""
2431-
global _uvloop_init_done
2432-
2433-
if _uvloop_init_done:
2434-
return
2435-
2436-
try:
2437-
import uvloop # type: ignore[reportMissingImports]
2438-
except ImportError:
2439-
pass
2440-
else:
2441-
uvloop.install() # type: ignore[reportUnknownMemberType]
2442-
2443-
_uvloop_init_done = True

0 commit comments

Comments
 (0)