Skip to content

Commit

Permalink
fix: install uvloop only < 3.13
Browse files Browse the repository at this point in the history
  • Loading branch information
phi-friday committed Oct 9, 2024
1 parent 5673cbf commit 169cc32
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 11 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Documentation = "https://async-wrapper.readthedocs.io/"
Repository = "https://github.com/phi-friday/async-wrapper"

[project.optional-dependencies]
uvloop = ["uvloop; platform_system != 'Windows'"]
uvloop = ["uvloop; platform_system != 'Windows' and python_version != '3.13'"]
sqlalchemy = ["sqlalchemy[asyncio]", "greenlet"]
test = [
"pytest>=8.0.0",
Expand Down
25 changes: 15 additions & 10 deletions src/tests/conftest.py
Original file line number Diff line number Diff line change
@@ -1,19 +1,24 @@
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=[
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",
)

@pytest.fixture(params=anyio_params, scope="session")
def anyio_backend(request: pytest.FixtureRequest) -> tuple[str, dict[str, Any]]:
return request.param

0 comments on commit 169cc32

Please sign in to comment.