Skip to content

Commit

Permalink
Revert "Use uvloop for asyncio"
Browse files Browse the repository at this point in the history
This reverts commit d11ba38.
This was done due to issues with uvloop when attempting to use uvloop
for our tests
  • Loading branch information
JHolba committed Dec 3, 2024
1 parent 03ee39a commit 309a535
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 9 deletions.
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ dependencies = [
"tabulate",
"tqdm>=4.62.0",
"typing_extensions>=4.5",
"uvloop",
"uvicorn >= 0.17.0",
"websockets",
"xarray",
Expand Down
9 changes: 3 additions & 6 deletions src/_ert/async_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@
import logging
import traceback
from contextlib import suppress
from typing import Any, Coroutine, Generator, Mapping, TypeVar, Union

import uvloop
from typing import Any, Coroutine, Generator, TypeVar, Union

logger = logging.getLogger(__name__)

Expand All @@ -15,7 +13,7 @@


def new_event_loop() -> asyncio.AbstractEventLoop:
loop = uvloop.new_event_loop()
loop = asyncio.new_event_loop()
loop.set_task_factory(_create_task)
return loop

Expand All @@ -32,10 +30,9 @@ def get_running_loop() -> asyncio.AbstractEventLoop:
def _create_task(
loop: asyncio.AbstractEventLoop,
coro: Union[Coroutine[Any, Any, _T], Generator[Any, None, _T]],
**kwargs: Mapping[str, Any],
) -> asyncio.Task[_T]:
assert asyncio.iscoroutine(coro)
task = asyncio.Task(coro, loop=loop, **kwargs) # type: ignore
task = asyncio.Task(coro, loop=loop)
task.add_done_callback(_done_callback)
return task

Expand Down
2 changes: 0 additions & 2 deletions src/ert/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
from typing import Any, Dict, Optional, Sequence, Union
from uuid import UUID

import uvloop
import yaml
from opentelemetry.instrumentation.threading import ThreadingInstrumentor
from opentelemetry.trace import Status, StatusCode
Expand Down Expand Up @@ -636,7 +635,6 @@ def log_process_usage() -> None:

@tracer.start_as_current_span("ert.application.start")
def main() -> None:
uvloop.install()
span = trace.get_current_span()
warnings.filterwarnings("ignore", category=DeprecationWarning)
locale.setlocale(locale.LC_NUMERIC, "C")
Expand Down

0 comments on commit 309a535

Please sign in to comment.