From fd8cb76202449a59ab1f5005554f2d6b8f983277 Mon Sep 17 00:00:00 2001 From: Paulo Cheque Date: Sun, 14 Sep 2025 09:50:04 -0300 Subject: [PATCH 1/3] Changed Loop Policy for Python 3.14 compatibility --- uvloop/__init__.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/uvloop/__init__.py b/uvloop/__init__.py index 9bb6592b..3db1a41f 100644 --- a/uvloop/__init__.py +++ b/uvloop/__init__.py @@ -3,7 +3,11 @@ import sys as _sys import warnings as _warnings -from asyncio.events import BaseDefaultEventLoopPolicy as __BasePolicy +try: + from asyncio.events import BaseDefaultEventLoopPolicy as __BasePolicy +except ImportError: + # Python 3.14 + from asyncio import DefaultEventLoopPolicy as __BasePolicy from . import includes as __includes # NOQA from .loop import Loop as __BaseLoop # NOQA From dc3f7b0142abb3a14acd40fdfd2a15f065665fa1 Mon Sep 17 00:00:00 2001 From: Paulo Cheque Date: Sun, 14 Sep 2025 09:55:16 -0300 Subject: [PATCH 2/3] Changed Loop Policy for Python 3.14 to 3.16 compatibility --- uvloop/__init__.py | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/uvloop/__init__.py b/uvloop/__init__.py index 3db1a41f..7354caed 100644 --- a/uvloop/__init__.py +++ b/uvloop/__init__.py @@ -3,12 +3,6 @@ import sys as _sys import warnings as _warnings -try: - from asyncio.events import BaseDefaultEventLoopPolicy as __BasePolicy -except ImportError: - # Python 3.14 - from asyncio import DefaultEventLoopPolicy as __BasePolicy - from . import includes as __includes # NOQA from .loop import Loop as __BaseLoop # NOQA from ._version import __version__ # NOQA @@ -143,7 +137,7 @@ def _cancel_all_tasks(loop: __asyncio.AbstractEventLoop) -> None: }) -class EventLoopPolicy(__BasePolicy): +class EventLoopPolicy(__asyncio.AbstractEventLoopPolicy): """Event loop policy. The preferred way to make your application use uvloop: From d749b0e45a73bc76c16ec073c7d8ca5698daff3b Mon Sep 17 00:00:00 2001 From: Paulo Cheque Date: Sun, 14 Sep 2025 10:07:26 -0300 Subject: [PATCH 3/3] include py 3.14 in CI scripts --- .github/workflows/release.yml | 1 + .github/workflows/tests.yml | 1 + 2 files changed, 2 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 29e7a7a4..d49bb4e7 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -83,6 +83,7 @@ jobs: - "cp311-*" - "cp312-*" - "cp313-*" + - "cp314-*" cibw_arch: ["x86_64", "aarch64", "universal2"] exclude: - os: ubuntu-latest diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index b5bdc6f3..bdf27875 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -22,6 +22,7 @@ jobs: - "3.11" - "3.12" - "3.13" + - "3.14" os: [ubuntu-latest, macos-latest] env: