Skip to content

Commit e89985f

Browse files
committed
Version 0.5.0.0
1 parent 28e9b9e commit e89985f

File tree

9 files changed

+730
-612
lines changed

9 files changed

+730
-612
lines changed

.circleci/config.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ executors:
88
parameters:
99
v:
1010
type: string
11-
default: "3.9"
11+
default: "3.10"
1212

1313
docker:
1414
- image: cimg/python:<< parameters.v >>
@@ -109,11 +109,11 @@ workflows:
109109
matrix:
110110
parameters:
111111
v:
112-
- "3.9"
113112
- "3.10"
114113
- "3.11"
115114
- "3.12"
116115
- "3.13"
116+
- "3.14"
117117

118118
- deploy:
119119
context: global

.pre-commit-config.yaml

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
repos:
22
- repo: https://github.com/pre-commit/pre-commit-hooks
3-
rev: v5.0.0
3+
rev: v6.0.0
44
hooks:
55
- id: check-merge-conflict
66
- repo: https://github.com/astral-sh/ruff-pre-commit
7-
rev: v0.8.4
7+
rev: v0.14.1
88
hooks:
9-
- id: ruff
9+
- id: ruff-check
1010
- id: ruff-format
1111
- repo: https://github.com/pre-commit/pre-commit-hooks
12-
rev: v5.0.0
12+
rev: v6.0.0
1313
hooks:
1414
- id: end-of-file-fixer
1515
- id: trailing-whitespace
@@ -27,9 +27,15 @@ repos:
2727
- id: debug-statements
2828
- id: fix-byte-order-marker
2929
- id: detect-private-key
30-
- repo: https://github.com/pre-commit/mirrors-prettier
31-
rev: v4.0.0-alpha.8
30+
- repo: local
3231
hooks:
3332
- id: prettier
33+
name: prettier
34+
types: [text]
35+
language: node
3436
require_serial: true
35-
args: ["--cache-location=.prettiercache"]
37+
entry: npx prettier --write --ignore-unknown
38+
- repo: https://github.com/astral-sh/uv-pre-commit
39+
rev: 0.9.4
40+
hooks:
41+
- id: uv-lock

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22

33
## Latest changes
44

5+
## 0.5.0.0
6+
7+
Support python 3.14
8+
9+
Drop python 3.9 support
10+
511
## 0.4.0.1
612

713
Fix event loop closing in some cases

pyproject.toml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,19 @@ description = "A library to help automate the creation of universal python libra
99
readme = "README.md"
1010
license = "MIT"
1111
authors = [{ name = "MrNaif2018", email = "[email protected]" }]
12-
requires-python = ">=3.9"
12+
requires-python = ">=3.10"
1313
classifiers = [
1414
"Development Status :: 5 - Production/Stable",
1515
"Intended Audience :: Developers",
1616
"Topic :: Software Development :: Libraries",
1717
"Topic :: Utilities",
1818
"License :: OSI Approved :: MIT License",
1919
"Programming Language :: Python :: 3",
20-
"Programming Language :: Python :: 3.9",
2120
"Programming Language :: Python :: 3.10",
2221
"Programming Language :: Python :: 3.11",
2322
"Programming Language :: Python :: 3.12",
2423
"Programming Language :: Python :: 3.13",
24+
"Programming Language :: Python :: 3.14",
2525
]
2626
keywords = [
2727
"async",
@@ -66,7 +66,7 @@ path = "universalasync/version.py"
6666
packages = ["universalasync"]
6767

6868
[tool.ruff]
69-
target-version = "py39"
69+
target-version = "py310"
7070
line-length = 127
7171

7272
[tool.ruff.lint]
@@ -102,6 +102,7 @@ warn_return_any = true
102102
no_implicit_optional = true
103103
strict_optional = true
104104
ignore_missing_imports = true
105+
exclude = ["tests"]
105106

106107
[tool.pytest.ini_options]
107108
addopts = ["--cov=universalasync", "--cov-report", "term-missing"]

universalasync/__init__.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,11 @@
22
import signal
33
from typing import Any
44

5-
from .utils import get_event_loop
6-
from .wrapper import async_to_sync_wraps, wrap
5+
from universalasync.utils import _get_event_loop_policy, get_event_loop
6+
from universalasync.wrapper import async_to_sync_wraps, wrap
77

8-
asyncio.get_event_loop_policy() # initialize default policy import-time to allow get_event_loop() to work even in finalizers
8+
# initialize default policy import-time to allow get_event_loop() to work even in finalizers
9+
_get_event_loop_policy()
910

1011

1112
@async_to_sync_wraps

universalasync/utils.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
import asyncio
2+
import sys
3+
from typing import TYPE_CHECKING
4+
5+
if TYPE_CHECKING:
6+
from asyncio.events import _AbstractEventLoopPolicy
27

38

49
def _create_new_event_loop() -> asyncio.AbstractEventLoop:
@@ -7,11 +12,17 @@ def _create_new_event_loop() -> asyncio.AbstractEventLoop:
712
return loop
813

914

15+
def _get_event_loop_policy() -> "_AbstractEventLoopPolicy":
16+
if sys.version_info >= (3, 14):
17+
return asyncio.events._get_event_loop_policy()
18+
return asyncio.get_event_loop_policy()
19+
20+
1021
def _get_event_loop() -> asyncio.AbstractEventLoop:
1122
current_loop = asyncio._get_running_loop()
1223
if current_loop is not None:
1324
return current_loop
14-
policy = asyncio.get_event_loop_policy()
25+
policy = _get_event_loop_policy()
1526
if policy._local._loop is not None:
1627
return policy._local._loop
1728
return _create_new_event_loop()

universalasync/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
VERSION = "0.4.0.1"
1+
VERSION = "0.5.0.0"

universalasync/wrapper.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
import functools
33
import inspect
44
import types
5-
from collections.abc import AsyncGenerator, Generator
6-
from typing import Any, Callable, cast
5+
from collections.abc import AsyncGenerator, Callable, Generator
6+
from typing import Any, cast
77

8-
from .utils import get_event_loop
8+
from universalasync.utils import get_event_loop
99

1010

1111
def iter_over_async(agen: AsyncGenerator, run_func: Callable) -> Generator:

0 commit comments

Comments
 (0)