Remove synapse.types.Collection (#9856)

This is no longer required, since we have dropped support for Python 3.5.
This commit is contained in:
Richard van der Hoff 2021-04-22 16:43:50 +01:00 committed by GitHub
parent 3186324260
commit 294c675033
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
26 changed files with 77 additions and 62 deletions

View file

@ -15,7 +15,7 @@
# limitations under the License.
import abc
import logging
from typing import Any, Dict, Iterable, List, Optional, Set, Tuple
from typing import Any, Collection, Dict, Iterable, List, Optional, Set, Tuple
from synapse.api.errors import Codes, StoreError
from synapse.logging.opentracing import (
@ -31,7 +31,7 @@ from synapse.storage.database import (
LoggingTransaction,
make_tuple_comparison_clause,
)
from synapse.types import Collection, JsonDict, get_verify_key_from_cross_signing_key
from synapse.types import JsonDict, get_verify_key_from_cross_signing_key
from synapse.util import json_decoder, json_encoder
from synapse.util.caches.descriptors import cached, cachedList
from synapse.util.caches.lrucache import LruCache

View file

@ -14,7 +14,7 @@
import itertools
import logging
from queue import Empty, PriorityQueue
from typing import Dict, Iterable, List, Set, Tuple
from typing import Collection, Dict, Iterable, List, Set, Tuple
from synapse.api.errors import StoreError
from synapse.events import EventBase
@ -25,7 +25,6 @@ from synapse.storage.databases.main.events_worker import EventsWorkerStore
from synapse.storage.databases.main.signatures import SignatureWorkerStore
from synapse.storage.engines import PostgresEngine
from synapse.storage.types import Cursor
from synapse.types import Collection
from synapse.util.caches.descriptors import cached
from synapse.util.caches.lrucache import LruCache
from synapse.util.iterutils import batch_iter

View file

@ -15,7 +15,16 @@
import logging
import threading
from collections import namedtuple
from typing import Container, Dict, Iterable, List, Optional, Tuple, overload
from typing import (
Collection,
Container,
Dict,
Iterable,
List,
Optional,
Tuple,
overload,
)
from constantly import NamedConstant, Names
from typing_extensions import Literal
@ -45,7 +54,7 @@ from synapse.storage.database import DatabasePool
from synapse.storage.engines import PostgresEngine
from synapse.storage.util.id_generators import MultiWriterIdGenerator, StreamIdGenerator
from synapse.storage.util.sequence import build_sequence_generator
from synapse.types import Collection, JsonDict, get_domain_from_id
from synapse.types import JsonDict, get_domain_from_id
from synapse.util.caches.descriptors import cached
from synapse.util.caches.lrucache import LruCache
from synapse.util.iterutils import batch_iter

View file

@ -13,7 +13,17 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import logging
from typing import TYPE_CHECKING, Dict, FrozenSet, Iterable, List, Optional, Set, Tuple
from typing import (
TYPE_CHECKING,
Collection,
Dict,
FrozenSet,
Iterable,
List,
Optional,
Set,
Tuple,
)
from synapse.api.constants import EventTypes, Membership
from synapse.events import EventBase
@ -33,7 +43,7 @@ from synapse.storage.roommember import (
ProfileInfo,
RoomsForUser,
)
from synapse.types import Collection, PersistedEventPosition, get_domain_from_id
from synapse.types import PersistedEventPosition, get_domain_from_id
from synapse.util.async_helpers import Linearizer
from synapse.util.caches import intern_string
from synapse.util.caches.descriptors import _CacheContext, cached, cachedList

View file

@ -15,7 +15,7 @@
import logging
import re
from collections import namedtuple
from typing import List, Optional, Set
from typing import Collection, List, Optional, Set
from synapse.api.errors import SynapseError
from synapse.events import EventBase
@ -23,7 +23,6 @@ from synapse.storage._base import SQLBaseStore, db_to_json, make_in_list_sql_cla
from synapse.storage.database import DatabasePool
from synapse.storage.databases.main.events_worker import EventRedactBehaviour
from synapse.storage.engines import PostgresEngine, Sqlite3Engine
from synapse.types import Collection
logger = logging.getLogger(__name__)

View file

@ -37,7 +37,7 @@ what sort order was used:
import abc
import logging
from collections import namedtuple
from typing import TYPE_CHECKING, Dict, List, Optional, Set, Tuple
from typing import TYPE_CHECKING, Collection, Dict, List, Optional, Set, Tuple
from twisted.internet import defer
@ -53,7 +53,7 @@ from synapse.storage.database import (
from synapse.storage.databases.main.events_worker import EventsWorkerStore
from synapse.storage.engines import BaseDatabaseEngine, PostgresEngine
from synapse.storage.util.id_generators import MultiWriterIdGenerator
from synapse.types import Collection, PersistedEventPosition, RoomStreamToken
from synapse.types import PersistedEventPosition, RoomStreamToken
from synapse.util.caches.descriptors import cached
from synapse.util.caches.stream_change_cache import StreamChangeCache