Skip to content

Commit e2576b6

Browse files
chore: Update mypy version (#1185)
Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
1 parent cfd7926 commit e2576b6

File tree

8 files changed

+9
-9
lines changed

8 files changed

+9
-9
lines changed

google/cloud/pubsub_v1/publisher/_batch/thread.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ def __init__(
9090
client: "PublisherClient",
9191
topic: str,
9292
settings: "types.BatchSettings",
93-
batch_done_callback: Callable[[bool], Any] = None,
93+
batch_done_callback: Optional[Callable[[bool], Any]] = None,
9494
commit_when_full: bool = True,
9595
commit_retry: "OptionalRetry" = gapic_v1.method.DEFAULT,
9696
commit_timeout: "types.OptionalTimeout" = gapic_v1.method.DEFAULT,

google/cloud/pubsub_v1/publisher/futures.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ def cancelled(self) -> bool:
4545
"""
4646
return False
4747

48-
def result(self, timeout: Union[int, float] = None) -> str:
48+
def result(self, timeout: Union[int, float, None] = None) -> str:
4949
"""Return the message ID or raise an exception.
5050
5151
This blocks until the message has been published successfully and

google/cloud/pubsub_v1/subscriber/_protocol/helper_threads.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
import logging
1616
import queue
1717
import time
18-
from typing import Any, Callable, List, Sequence
18+
from typing import Any, Callable, List, Sequence, Optional
1919
import uuid
2020

2121

@@ -32,7 +32,7 @@
3232

3333

3434
def _get_many(
35-
queue_: queue.Queue, max_items: int = None, max_latency: float = 0
35+
queue_: queue.Queue, max_items: Optional[int] = None, max_latency: float = 0
3636
) -> List[Any]:
3737
"""Get multiple items from a Queue.
3838

google/cloud/pubsub_v1/subscriber/_protocol/streaming_pull_manager.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ def __init__(
267267
client: "subscriber.Client",
268268
subscription: str,
269269
flow_control: types.FlowControl = types.FlowControl(),
270-
scheduler: ThreadScheduler = None,
270+
scheduler: Optional[ThreadScheduler] = None,
271271
use_legacy_flow_control: bool = False,
272272
await_callbacks_on_shutdown: bool = False,
273273
):

google/cloud/pubsub_v1/subscriber/futures.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ def cancelled(self) -> bool:
104104
"""
105105
return False
106106

107-
def result(self, timeout: Union[int, float] = None) -> AcknowledgeStatus:
107+
def result(self, timeout: Union[int, float, None] = None) -> AcknowledgeStatus:
108108
"""Return a success code or raise an exception.
109109
110110
This blocks until the operation completes successfully and

google/cloud/pubsub_v1/subscriber/scheduler.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ def shutdown(
162162
work_item = self._executor._work_queue.get(block=False)
163163
if work_item is None: # Exceutor in shutdown mode.
164164
continue
165-
dropped_messages.append(work_item.args[0])
165+
dropped_messages.append(work_item.args[0]) # type: ignore[index]
166166
except queue.Empty:
167167
pass
168168

noxfile.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
ISORT_VERSION = "isort==5.11.0"
3333
LINT_PATHS = ["docs", "google", "tests", "noxfile.py", "setup.py"]
3434

35-
MYPY_VERSION = "mypy==0.910"
35+
MYPY_VERSION = "mypy==1.10.0"
3636

3737
DEFAULT_PYTHON_VERSION = "3.8"
3838

owlbot.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,7 @@
348348
s.replace(
349349
"noxfile.py",
350350
r"LINT_PATHS = \[.*?\]",
351-
'\g<0>\n\nMYPY_VERSION = "mypy==0.910"',
351+
'\g<0>\n\nMYPY_VERSION = "mypy==1.10.0"',
352352
)
353353
s.replace(
354354
"noxfile.py", r'"blacken",', '\g<0>\n "mypy",',

0 commit comments

Comments
 (0)