ci: ignore mismatched pos-only args on mypy 3.9

This commit is contained in:
Sean Breckenridge 2022-01-26 17:01:31 -08:00
parent 1d49b87b9b
commit 7a63838d3b

View file

@ -599,6 +599,7 @@ def assert_subpackage(name: str) -> None:
# NOTE: if we use overlay, name can be smth like my.origg.my.core.cachew ...
assert name == '__main__' or 'my.core' in name, f'Expected module __name__ ({name}) to be __main__ or start with my.core'
_T = TypeVar("_T")
# https://stackoverflow.com/a/10436851/706389
from concurrent.futures import Future, Executor
@ -607,7 +608,11 @@ class DummyExecutor(Executor):
self._shutdown = False
self._max_workers = max_workers
def submit(self, fn, *args, **kwargs) -> Future:
# TODO: once support for 3.7 is dropped,
# can make 'fn' a positional only parameter,
# which fixes the mypy error this throws without the type: ignore
def submit(self, fn: Callable[..., _T], *args: Any, **kwargs: Any) -> Future[_T]: # type: ignore[override]
if self._shutdown:
raise RuntimeError('cannot schedule new futures after shutdown')
@ -623,5 +628,5 @@ class DummyExecutor(Executor):
return f
def shutdown(self, wait: bool=True) -> None:
def shutdown(self, wait: bool=True) -> None: # type: ignore[override]
self._shutdown = True