Skip to content

Adapt to asyncgui 0.7.0 #14

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Aug 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
12 changes: 6 additions & 6 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -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ō <[email protected]>"]
license = "MIT"
Expand All @@ -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"
Expand Down
4 changes: 2 additions & 2 deletions sphinx/readme_jp.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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"

テスト環境
-----------------------
Expand Down
3 changes: 3 additions & 0 deletions src/asyncgui_ext/clock.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
'''
Expand Down
12 changes: 6 additions & 6 deletions tests/clock/test_run_in_executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Loading