Skip to content

Commit

Permalink
fix: py313 uvloop
Browse files Browse the repository at this point in the history
  • Loading branch information
phi-friday committed Oct 17, 2024
1 parent a4378f0 commit 5ea7624
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 16 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ dependencies = [
Repository = "https://github.com/phi-friday/timeout-executor"

[project.optional-dependencies]
uvloop = ["uvloop; platform_system != 'Windows' and python_version != '3.13'"]
uvloop = ["uvloop; platform_system != 'Windows'"]
jinja = ["jinja2>=3.0.0"]
test = [
"httpx>=0.27.2",
Expand Down
25 changes: 10 additions & 15 deletions src/tests/conftest.py
Original file line number Diff line number Diff line change
@@ -1,24 +1,19 @@
from __future__ import annotations

import sys
from typing import Any

import pytest

anyio_params = [
pytest.param(("asyncio", {"use_uvloop": False}), id="asyncio"),
pytest.param(
("trio", {"restrict_keyboard_interrupt_to_checkpoints": True}), id="trio"
),
]
if sys.version_info < (3, 13):
# FIXME: uvloop build error
# see more: https://github.com/MagicStack/uvloop/issues/622
anyio_params.append(
pytest.param(("asyncio", {"use_uvloop": True}), id="asyncio-uvloop")
)


@pytest.fixture(params=anyio_params, scope="session")
@pytest.fixture(
params=[
pytest.param(("asyncio", {"use_uvloop": False}), id="asyncio"),
pytest.param(("asyncio", {"use_uvloop": True}), id="asyncio-uvloop"),
pytest.param(
("trio", {"restrict_keyboard_interrupt_to_checkpoints": True}), id="trio"
),
],
scope="session",
)
def anyio_backend(request: pytest.FixtureRequest) -> tuple[str, dict[str, Any]]:
return request.param

0 comments on commit 5ea7624

Please sign in to comment.