diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index dcd6f40..b4b093a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,7 +14,7 @@ jobs: strategy: fail-fast: false matrix: - python: ['3.7', '3.8', '3.9', '3.10', '3.11'] + python: ['3.8', '3.9', '3.10', '3.11', '3.12'] arch: ['x86', 'x64'] steps: - name: Checkout @@ -53,7 +53,7 @@ jobs: strategy: fail-fast: false matrix: - python: ['pypy-3.8', 'pypy-3.9', '3.7', '3.8', '3.9', '3.10', '3.11', '3.12-dev'] + python: ['pypy-3.8', 'pypy-3.9', '3.8', '3.9', '3.10', '3.11', '3.12', '3.13-dev'] check_lint: ['0'] extra_name: [''] include: diff --git a/README.rst b/README.rst index f11f75f..19888bf 100644 --- a/README.rst +++ b/README.rst @@ -36,7 +36,7 @@ cleanliness and good test coverage, please be advised that good idea at the time, and should be treated with according skepticism if you're contemplating using it in production. It hasn't necessarily been reviewed or tested to Trio's standards, it supports at minimum -Python 3.7, and some features might not be available on PyPy or on +Python 3.8, and some features might not be available on PyPy or on Windows. * If you find that it meets your needs, you're welcome to use it. We'll diff --git a/docs-requirements.in b/docs-requirements.in index 0c4cef1..6a54844 100644 --- a/docs-requirements.in +++ b/docs-requirements.in @@ -2,5 +2,4 @@ sphinx >= 1.7.0 sphinx_rtd_theme sphinxcontrib-trio towncrier -trio >= 0.15.0 -trio-typing >= 0.5.0 +trio >= 0.23.0 diff --git a/docs-requirements.txt b/docs-requirements.txt index 75694de..0c3e603 100644 --- a/docs-requirements.txt +++ b/docs-requirements.txt @@ -1,14 +1,11 @@ # -# This file is autogenerated by pip-compile with Python 3.9 +# This file is autogenerated by pip-compile with Python 3.12 # by the following command: # # pip-compile docs-requirements.in # - alabaster==0.7.13 # via sphinx -async-generator==1.10 - # via trio attrs==23.1.0 # via # outcome @@ -29,16 +26,12 @@ docutils==0.18.1 # via # sphinx # sphinx-rtd-theme -exceptiongroup==1.1.1 - # via trio idna==3.4 # via # requests # trio imagesize==1.4.1 # via sphinx -importlib-metadata==6.6.0 - # via sphinx incremental==22.10.0 # via towncrier jinja2==3.1.2 @@ -47,8 +40,6 @@ jinja2==3.1.2 # towncrier markupsafe==2.1.3 # via jinja2 -mypy-extensions==1.0.0 - # via trio-typing outcome==1.2.0 # via trio packaging==23.1 @@ -87,22 +78,12 @@ sphinxcontrib-serializinghtml==1.1.5 # via sphinx sphinxcontrib-trio==1.1.2 # via -r docs-requirements.in -tomli==2.0.1 - # via towncrier towncrier==22.12.0 # via -r docs-requirements.in -trio==0.22.0 - # via - # -r docs-requirements.in - # trio-typing -trio-typing==0.8.0 +trio==0.24.0 # via -r docs-requirements.in -typing-extensions==4.6.3 - # via trio-typing urllib3==2.0.2 # via requests -zipp==3.15.0 - # via importlib-metadata # The following packages are considered to be unsafe in a requirements file: # setuptools diff --git a/pyproject.toml b/pyproject.toml index 6a71f3a..4bd6f90 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,5 +1,5 @@ [tool.black] -target-version = ['py37'] +target-version = ['py38'] [tool.towncrier] package = "tricycle" diff --git a/setup.py b/setup.py index da6590d..52638a3 100644 --- a/setup.py +++ b/setup.py @@ -15,9 +15,9 @@ license="MIT -or- Apache License 2.0", packages=find_packages(), include_package_data=True, - install_requires=["trio >= 0.15.0", "trio-typing >= 0.5.0"], + install_requires=["trio >= 0.23.0"], keywords=["async", "trio"], - python_requires=">=3.7", + python_requires=">=3.8", classifiers=[ "License :: OSI Approved :: MIT License", "License :: OSI Approved :: Apache Software License", diff --git a/test-requirements.in b/test-requirements.in index 9fc2015..3b9a635 100644 --- a/test-requirements.in +++ b/test-requirements.in @@ -5,12 +5,11 @@ pytest-trio >= 0.6.0 # Tools black; implementation_name == "cpython" -mypy >= 0.780; implementation_name == "cpython" +mypy >= 1.8.0; implementation_name == "cpython" # 6.0.0 requires py3.8+: flake8 < 6.0.0 # Project dependencies attrs >= 19.2.0 async_generator >= 1.9 -trio >= 0.15.0 -trio-typing >= 0.5.0 +trio >= 0.23.0 diff --git a/test-requirements.txt b/test-requirements.txt index 8b4b424..12d5f92 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -1,28 +1,24 @@ # -# This file is autogenerated by pip-compile with Python 3.9 +# This file is autogenerated by pip-compile with Python 3.12 # by the following command: # # pip-compile test-requirements.in # - async-generator==1.10 - # via - # -r test-requirements.in - # trio + # via -r test-requirements.in attrs==23.1.0 # via # -r test-requirements.in + # outcome # trio black==23.3.0 ; implementation_name == "cpython" # via -r test-requirements.in click==8.1.3 # via black coverage[toml]==7.2.7 - # via pytest-cov -exceptiongroup==1.1.1 # via - # pytest - # trio + # coverage + # pytest-cov flake8==5.0.4 # via -r test-requirements.in idna==3.4 @@ -31,13 +27,12 @@ iniconfig==2.0.0 # via pytest mccabe==0.7.0 # via flake8 -mypy==1.3.0 ; implementation_name == "cpython" +mypy==1.8.0 ; implementation_name == "cpython" # via -r test-requirements.in mypy-extensions==1.0.0 # via # black # mypy - # trio-typing outcome==1.2.0 # via # pytest-trio @@ -69,20 +64,9 @@ sniffio==1.3.0 # via trio sortedcontainers==2.4.0 # via trio -tomli==2.0.1 - # via - # black - # mypy - # pytest -trio==0.22.0 +trio==0.24.0 # via # -r test-requirements.in # pytest-trio - # trio-typing -trio-typing==0.8.0 - # via -r test-requirements.in typing-extensions==4.6.3 - # via - # black - # mypy - # trio-typing + # via mypy diff --git a/tricycle/_service_nursery.py b/tricycle/_service_nursery.py index 1303df3..5b7d36b 100644 --- a/tricycle/_service_nursery.py +++ b/tricycle/_service_nursery.py @@ -1,10 +1,8 @@ -import attr import collections import trio -from trio_typing import TaskStatus from functools import partial from contextlib import asynccontextmanager -from typing import Any, AsyncIterator, Awaitable, Callable, Optional, overload +from typing import Any, AsyncIterator, Awaitable, Callable, Optional from ._multi_cancel import MultiCancelScope @@ -112,7 +110,7 @@ async def start( *args: Any, name: Optional[str] = None, ) -> Any: - async def wrap_child(*, task_status: TaskStatus[Any]) -> None: + async def wrap_child(*, task_status: trio.TaskStatus[Any]) -> None: # For start(), the child doesn't get shielded until it # calls task_status.started(). shield_scope = child_task_scopes.open_child(shield=False) diff --git a/tricycle/_tests/test_meta.py b/tricycle/_tests/test_meta.py index 2ffa68f..5cd9b7a 100644 --- a/tricycle/_tests/test_meta.py +++ b/tricycle/_tests/test_meta.py @@ -4,8 +4,7 @@ import trio import trio.testing from contextlib import asynccontextmanager -from typing import Any, AsyncIterator, Coroutine, Iterator, List -from trio_typing import TaskStatus +from typing import AsyncIterator, Coroutine, Iterator, List from .. import ScopedObject, BackgroundObject @@ -109,7 +108,7 @@ async def __close__(self) -> None: self.record.append("close") self.exiting = True - async def _background_task(self, *, task_status: TaskStatus[None]) -> None: + async def _background_task(self, *, task_status: trio.TaskStatus[None]) -> None: self.record.append("background") await trio.sleep(1) self.record.append("starting") diff --git a/tricycle/_tests/test_rwlock.py b/tricycle/_tests/test_rwlock.py index ba359dd..1a2798c 100644 --- a/tricycle/_tests/test_rwlock.py +++ b/tricycle/_tests/test_rwlock.py @@ -4,7 +4,6 @@ import trio.testing from .. import RWLock from typing import List, Optional -from trio_typing import TaskStatus async def test_rwlock(autojump_clock: trio.testing.MockClock) -> None: @@ -41,7 +40,7 @@ async def test_rwlock(autojump_clock: trio.testing.MockClock) -> None: acquire_times: List[Optional[float]] = [None] * 10 async def holder_task( - for_write: bool, task_status: TaskStatus[trio.lowlevel.Task] + for_write: bool, task_status: trio.TaskStatus[trio.lowlevel.Task] ) -> None: my_slot = next(start_order) repr(lock) # smoke test @@ -150,7 +149,7 @@ async def test_read_biased(autojump_clock: trio.testing.MockClock) -> None: assert lock.read_biased async def holder_task( - for_write: bool, task_status: TaskStatus[trio.lowlevel.Task] + for_write: bool, task_status: trio.TaskStatus[trio.lowlevel.Task] ) -> None: task_status.started(trio.lowlevel.current_task()) await lock.acquire(for_write=for_write) diff --git a/tricycle/_tests/test_service_nursery.py b/tricycle/_tests/test_service_nursery.py index cc8e5db..7ffab73 100644 --- a/tricycle/_tests/test_service_nursery.py +++ b/tricycle/_tests/test_service_nursery.py @@ -1,6 +1,5 @@ import pytest from typing import Any -from trio_typing import TaskStatus import trio import trio.testing @@ -35,7 +34,7 @@ async def background_task() -> None: async def test_start(autojump_clock: trio.testing.MockClock) -> None: record = [] - async def sleep_then_start(val: int, *, task_status: TaskStatus[int]) -> None: + async def sleep_then_start(val: int, *, task_status: trio.TaskStatus[int]) -> None: await trio.sleep(1) task_status.started(val) try: @@ -44,7 +43,7 @@ async def sleep_then_start(val: int, *, task_status: TaskStatus[int]) -> None: finally: record.append("background task exiting") - async def shielded_sleep_then_start(*, task_status: TaskStatus[None]) -> None: + async def shielded_sleep_then_start(*, task_status: trio.TaskStatus[None]) -> None: with trio.CancelScope(shield=True): await trio.sleep(1) task_status.started() @@ -83,7 +82,7 @@ async def shielded_sleep_then_start(*, task_status: TaskStatus[None]) -> None: async def test_problems() -> None: async with open_service_nursery() as nursery: with pytest.raises(TypeError) as info: - nursery.start_soon(trio.sleep) + nursery.start_soon(trio.sleep) # type: ignore[arg-type] assert "missing 1 required positional argument" in str(info.value) with pytest.raises(TypeError) as info: diff --git a/tricycle/_tests/test_tree_var.py b/tricycle/_tests/test_tree_var.py index 0e54f34..804b89e 100644 --- a/tricycle/_tests/test_tree_var.py +++ b/tricycle/_tests/test_tree_var.py @@ -2,7 +2,6 @@ import trio import trio.testing from functools import partial -from trio_typing import TaskStatus from typing import Optional, Any, cast from .. import TreeVar, TreeVarToken @@ -69,7 +68,7 @@ def trivial_abort(_: object) -> trio.lowlevel.Abort: async def test_treevar_follows_eventual_parent() -> None: tv1 = TreeVar[str]("tv1") - async def manage_target(task_status: TaskStatus[trio.Nursery]) -> None: + async def manage_target(task_status: trio.TaskStatus[trio.Nursery]) -> None: assert tv1.get() == "source nursery" with tv1.being("target nursery"): assert tv1.get() == "target nursery" @@ -84,7 +83,7 @@ async def manage_target(task_status: TaskStatus[trio.Nursery]) -> None: assert tv1.get() == "source nursery" async def verify( - value: str, *, task_status: TaskStatus[None] = trio.TASK_STATUS_IGNORED + value: str, *, task_status: trio.TaskStatus[None] = trio.TASK_STATUS_IGNORED ) -> None: assert tv1.get() == value task_status.started()