Skip to content
Snippets Groups Projects
Commit 68d27741 authored by Antoine Lambert's avatar Antoine Lambert
Browse files

mypy: Bump to 1.0 and fix new typing errors

Related to swh/meta#4960
parent 4f3d8c12
No related branches found
No related tags found
No related merge requests found
Pipeline #858 failed
...@@ -19,7 +19,7 @@ class SortedList(Generic[SortedListKey, SortedListItem]): ...@@ -19,7 +19,7 @@ class SortedList(Generic[SortedListKey, SortedListItem]):
def __init__( def __init__(
self, self,
data: List[SortedListItem] = None, data: List[SortedListItem] = [],
key: Optional[Callable[[SortedListItem], SortedListKey]] = None, key: Optional[Callable[[SortedListItem], SortedListKey]] = None,
): ):
if key is None: if key is None:
......
...@@ -8,7 +8,7 @@ import datetime ...@@ -8,7 +8,7 @@ import datetime
from enum import IntEnum from enum import IntEnum
import inspect import inspect
from string import printable from string import printable
from typing import Any from typing import Any, Callable
from unittest.mock import MagicMock, Mock from unittest.mock import MagicMock, Mock
import uuid import uuid
...@@ -17,17 +17,12 @@ from hypothesis.extra.pytz import timezones ...@@ -17,17 +17,12 @@ from hypothesis.extra.pytz import timezones
import psycopg2 import psycopg2
import pytest import pytest
from pytest_postgresql import factories from pytest_postgresql import factories
from typing_extensions import Protocol
from swh.core.db import BaseDb from swh.core.db import BaseDb
from swh.core.db.common import db_transaction, db_transaction_generator from swh.core.db.common import db_transaction, db_transaction_generator
from swh.core.db.tests.conftest import function_scoped_fixture_check from swh.core.db.tests.conftest import function_scoped_fixture_check
Converter = Callable[[Any], Any]
# workaround mypy bug https://github.com/python/mypy/issues/5485
class Converter(Protocol):
def __call__(self, x: Any) -> Any:
...
@dataclass @dataclass
......
...@@ -50,7 +50,7 @@ extras = ...@@ -50,7 +50,7 @@ extras =
http http
github github
deps = deps =
mypy==0.942 mypy==1.0
commands = commands =
mypy swh mypy swh
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment