chore: stricter mypy config
This commit is contained in:
@@ -47,4 +47,4 @@ repos:
|
||||
- types-aiofiles
|
||||
- typing-extensions<5
|
||||
- uvloop<0.22; implementation_name=='cpython' and (sys_platform=='darwin' or sys_platform=='linux')
|
||||
- winloop<0.1.7; implementation_name=='cpython' and (sys_platform=='cygwin' or sys_platform=='win32')
|
||||
- winloop<0.1.8; implementation_name=='cpython' and (sys_platform=='cygwin' or sys_platform=='win32')
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
[mypy]
|
||||
follow_untyped_imports = True
|
||||
python_version = 3.9
|
||||
disallow_subclassing_any = False
|
||||
disallow_untyped_calls = False
|
||||
|
||||
@@ -53,23 +53,23 @@ _logger = logging.getLogger(__name__)
|
||||
def get_async_run() -> Callable[[Coroutine[Any, Any, T]], T]:
|
||||
if sys.implementation.name == "cpython":
|
||||
try:
|
||||
import uvloop # type: ignore[import-not-found, unused-ignore] # noqa: PLC0415
|
||||
import uvloop # noqa: PLC0415
|
||||
except ImportError:
|
||||
pass
|
||||
else:
|
||||
try:
|
||||
return uvloop.run # type: ignore[no-any-return, unused-ignore]
|
||||
return uvloop.run # type: ignore[no-any-return]
|
||||
except AttributeError:
|
||||
uvloop.install()
|
||||
return asyncio.run
|
||||
|
||||
try:
|
||||
import winloop # type: ignore[import-not-found, unused-ignore] # noqa: PLC0415
|
||||
import winloop # noqa: PLC0415
|
||||
except ImportError:
|
||||
pass
|
||||
else:
|
||||
try:
|
||||
return winloop.run # type: ignore[no-any-return, unused-ignore]
|
||||
return winloop.run # type: ignore[no-any-return]
|
||||
except AttributeError:
|
||||
winloop.install()
|
||||
return asyncio.run
|
||||
|
||||
Reference in New Issue
Block a user