Skip to content

Commit ef8090e

Browse files
khiemdoantiangolopre-commit-ci[bot]
authored
✨ Add support for AnyIO 4.x, drop support for Python 3.7 (#90)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent f6bbf79 commit ef8090e

File tree

5 files changed

+11
-6
lines changed

5 files changed

+11
-6
lines changed

.github/actions/comment-docs-preview-in-pr/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM python:3.7
1+
FROM python:3.8
22

33
RUN pip install --no-cache-dir httpx "pydantic==1.5.1" pygithub
44

.github/workflows/test.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@ jobs:
2121
strategy:
2222
matrix:
2323
python-version:
24-
- "3.7"
2524
- "3.8"
2625
- "3.9"
2726
- "3.10"
27+
- "3.11"
2828
fail-fast: false
2929

3030
steps:

asyncer/_main.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ def wrapper(
158158
soon_value: SoonValue[T] = SoonValue()
159159

160160
@functools.wraps(partial_f)
161-
async def value_wrapper() -> None:
161+
async def value_wrapper(*args: Any) -> None:
162162
value = await partial_f()
163163
soon_value._stored_value = value
164164

pyproject.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ classifiers = [
2828
]
2929

3030
[tool.poetry.dependencies]
31-
python = "^3.7"
32-
anyio = "^3.4.0"
31+
python = "^3.8"
32+
anyio = ">=3.4.0,<5.0"
3333

3434
[tool.poetry.dev-dependencies]
3535
pytest = "^7.0.1"

tests/test_tutorial/test_soonify_return/test_tutorial002.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
1+
import sys
12
from unittest.mock import patch
23

34
import asyncer
45
import pytest
56

7+
if sys.version_info < (3, 11):
8+
from exceptiongroup import ExceptionGroup
9+
610
from ...conftest import get_testing_print_function
711

812

@@ -12,9 +16,10 @@ def test_tutorial():
1216
new_print = get_testing_print_function(calls)
1317

1418
with patch("builtins.print", new=new_print):
15-
with pytest.raises(asyncer.PendingValueException):
19+
with pytest.raises(ExceptionGroup) as e:
1620
from docs_src.tutorial.soonify_return import tutorial002 as mod
1721

1822
# Avoid autoflake removing this import
1923
assert mod # pragma: nocover
24+
assert isinstance(e.value.exceptions[0], asyncer.PendingValueException)
2025
assert calls == []

0 commit comments

Comments
 (0)