Skip to content

Commit

Permalink
✨ Add support for AnyIO 4.x, drop support for Python 3.7 (#90)
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
3 people authored Jan 23, 2024
1 parent f6bbf79 commit ef8090e
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/actions/comment-docs-preview-in-pr/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM python:3.7
FROM python:3.8

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

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ jobs:
strategy:
matrix:
python-version:
- "3.7"
- "3.8"
- "3.9"
- "3.10"
- "3.11"
fail-fast: false

steps:
Expand Down
2 changes: 1 addition & 1 deletion asyncer/_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ def wrapper(
soon_value: SoonValue[T] = SoonValue()

@functools.wraps(partial_f)
async def value_wrapper() -> None:
async def value_wrapper(*args: Any) -> None:
value = await partial_f()
soon_value._stored_value = value

Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ classifiers = [
]

[tool.poetry.dependencies]
python = "^3.7"
anyio = "^3.4.0"
python = "^3.8"
anyio = ">=3.4.0,<5.0"

[tool.poetry.dev-dependencies]
pytest = "^7.0.1"
Expand Down
7 changes: 6 additions & 1 deletion tests/test_tutorial/test_soonify_return/test_tutorial002.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
import sys
from unittest.mock import patch

import asyncer
import pytest

if sys.version_info < (3, 11):
from exceptiongroup import ExceptionGroup

from ...conftest import get_testing_print_function


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

with patch("builtins.print", new=new_print):
with pytest.raises(asyncer.PendingValueException):
with pytest.raises(ExceptionGroup) as e:
from docs_src.tutorial.soonify_return import tutorial002 as mod

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

0 comments on commit ef8090e

Please sign in to comment.