diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index e17fd1f..132faf3 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -24,7 +24,7 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - python -m pip install pytest "asyncgui>=0.6,<0.7" + python -m pip install pytest "asyncgui>=0.7,<0.8" python -m pip install . - name: Test with pytest run: make test diff --git a/poetry.lock b/poetry.lock index d9b3dd7..adc4180 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1,4 +1,4 @@ -# This file is automatically @generated by Poetry 1.5.1 and should not be changed by hand. +# This file is automatically @generated by Poetry 1.8.3 and should not be changed by hand. [[package]] name = "alabaster" @@ -13,13 +13,13 @@ files = [ [[package]] name = "asyncgui" -version = "0.6.3" +version = "0.7.0" description = "A thin layer that helps to wrap a callback-style API in an async/await-style API" optional = false -python-versions = "<4.0.0,>=3.8.1" +python-versions = "<4.0,>=3.9" files = [ - {file = "asyncgui-0.6.3-py3-none-any.whl", hash = "sha256:46723e65d8bf023e28d141f6a9d38634ef5b97a5236fafdaf80b47e13275a5eb"}, - {file = "asyncgui-0.6.3.tar.gz", hash = "sha256:05de49c2221128d3530f010df98491f3553183ec8909d205a0c0250bee5d6e0c"}, + {file = "asyncgui-0.7.0-py3-none-any.whl", hash = "sha256:c1e53b5c0c4df8817b28aa58bda3bc13752ea65519b14c2d7fa1c1721c9bb362"}, + {file = "asyncgui-0.7.0.tar.gz", hash = "sha256:6a5cfdfee34f6478e857a55ff88981995479930c3ddc577c5ff9d85a79f12a4a"}, ] [package.dependencies] @@ -689,4 +689,4 @@ zstd = ["zstandard (>=0.18.0)"] [metadata] lock-version = "2.0" python-versions = "^3.10" -content-hash = "0574aa0ad567c55ddbdd482fa695f239d8c24b0fbe586638588f6cfc87dd61b3" +content-hash = "8ef8c79bc9e7fbe9aa362dce6daf9d48d76c0a0447e9947d11c08c5dc098f9d5" diff --git a/pyproject.toml b/pyproject.toml index e3dfd1a..8433291 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "asyncgui-ext-clock" -version = "0.5.0" +version = "0.5.1" description = "An event scheduler for asyncgui programs" authors = ["Nattōsai Mitō "] license = "MIT" @@ -25,7 +25,7 @@ packages = [ [tool.poetry.dependencies] python = "^3.10" -asyncgui = "~0.6" +asyncgui = ">=0.6" [tool.poetry.group.dev.dependencies] pytest = "^7.4.3" diff --git a/sphinx/readme_jp.rst b/sphinx/readme_jp.rst index 7afe1b5..fd71cc1 100644 --- a/sphinx/readme_jp.rst +++ b/sphinx/readme_jp.rst @@ -55,8 +55,8 @@ APIに渡す時間の単位は統一さえされていれば何でも構いま :: - poetry add asyncgui-ext-clock@~0.4 - pip install "asyncgui-ext-clock>=0.4,<0.5" + poetry add asyncgui-ext-clock@~0.5 + pip install "asyncgui-ext-clock>=0.5,<0.6" テスト環境 ----------------------- diff --git a/src/asyncgui_ext/clock.py b/src/asyncgui_ext/clock.py index 4d3e959..52b5b2b 100644 --- a/src/asyncgui_ext/clock.py +++ b/src/asyncgui_ext/clock.py @@ -374,6 +374,9 @@ async def interpolate_sequence(self, start, end, *, duration, step=0, transition yield output_type(p * slope_elem + start_elem for slope_elem, start_elem in zip_(slope, start)) interpolate_seq = interpolate_sequence + ''' + An alias for :meth:`interpolate_sequence`. + ''' async def run_in_thread(self, func, *, daemon=None, polling_interval) -> Awaitable: ''' diff --git a/tests/clock/test_run_in_executor.py b/tests/clock/test_run_in_executor.py index bea0b9a..5191263 100644 --- a/tests/clock/test_run_in_executor.py +++ b/tests/clock/test_run_in_executor.py @@ -45,22 +45,22 @@ async def job(): def test_cancel_before_getting_excuted(clock): import time - from asyncgui import Event, start + from asyncgui import Box, start - flag = Event() + box = Box() async def job(): - await clock.run_in_executor(executor, flag.set, polling_interval=0) + await clock.run_in_executor(executor, box.put, polling_interval=0) with ThreadPoolExecutor(max_workers=1) as executor: executor.submit(time.sleep, .1) task = start(job()) time.sleep(.02) assert not task.finished - assert not flag.is_set + assert box.is_empty clock.tick(0) task.cancel() assert task.cancelled - assert not flag.is_set + assert box.is_empty time.sleep(.2) - assert not flag.is_set + assert box.is_empty