Skip to content

Commit 1e5563c

Browse files
committed
mypy: use latest mypy
1 parent 76a3ce7 commit 1e5563c

File tree

5 files changed

+35
-29
lines changed

5 files changed

+35
-29
lines changed

boostedblob/boost.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -544,7 +544,9 @@ async def eagerly_buffer(self) -> None:
544544
# We can't use async for because we need to preserve exceptions
545545
it = self.iterable.__aiter__()
546546
while True:
547-
task = asyncio.create_task(it.__anext__())
547+
# I guess in theory, __anext__ isn't guaranteed to be a coroutine
548+
# https://github.com/hauntsaninja/boostedblob/pull/12
549+
task: asyncio.Task[T] = asyncio.create_task(it.__anext__()) # type: ignore [arg-type]
548550
try:
549551
await task
550552
except StopAsyncIteration:

boostedblob/cli.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@
66
import subprocess
77
import sys
88
import tempfile
9-
from typing import Any, AsyncIterator, Awaitable, Callable, Dict, List, Optional, TypeVar, cast
9+
from typing import Any, AsyncIterator, Callable, Coroutine, Dict, List, Optional, TypeVar, cast
1010

1111
import boostedblob as bbb
1212

1313
F = TypeVar("F", bound=Callable[..., Any])
1414
T = TypeVar("T")
1515

1616

17-
def syncify(fn: Callable[..., Awaitable[T]]) -> Callable[..., T]:
17+
def syncify(fn: Callable[..., Coroutine[T, None, None]]) -> Callable[..., T]:
1818
@functools.wraps(fn)
1919
def wrapper(*args: Any, **kwargs: Any) -> Any:
2020
try:

poetry.lock

Lines changed: 27 additions & 23 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ filelock = "*"
6262
ipdb = "*"
6363
black = "^22.6"
6464
isort = "^5.7.0"
65-
mypy = "^0.931"
65+
mypy = "^0.971"
6666
flake8 = "^3.8.3"
6767
types-xmltodict = "^0.12.0"
6868

tests/test_boost.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ async def test_map_ordered_single():
5555
assert e.semaphore._value == 0
5656
assert set(futures) == set()
5757

58-
next_task = asyncio.create_task(it.__anext__())
58+
next_task = asyncio.create_task(it.__anext__()) # type: ignore[arg-type]
5959
await pause()
6060
assert set(futures) == {0}
6161

@@ -70,7 +70,7 @@ async def test_map_ordered_single():
7070
assert next_task.done()
7171
assert (await next_task) == 0
7272

73-
next_task = asyncio.create_task(it.__anext__())
73+
next_task = asyncio.create_task(it.__anext__()) # type: ignore[arg-type]
7474
await pause()
7575
assert not next_task.done()
7676
futures[1].set_result(None)

0 commit comments

Comments
 (0)