Browse Source

py38: import conversions to collections.abc where applicable (#28432)

josh 3 years ago
parent
commit
d15e14f01c

+ 1 - 0
pyproject.toml

@@ -41,6 +41,7 @@ filterwarnings = [
     # TODO(joshuarli): Upgrade responses, then revisit this.
     #                  It'll probably show up in other dependencies.
     "ignore::DeprecationWarning",
+    "error:Using or importing the ABCs from 'collections':DeprecationWarning",
 
     # At writing, the Google Bigtable Emulator relies on deprecated behavior
     # internally, this can be removed once a version containing this fix is

+ 1 - 1
src/sentry/analytics/event.py

@@ -3,7 +3,7 @@ from sentry.utils.compat import map
 __all__ = ("Attribute", "Event", "Map")
 
 from base64 import b64encode
-from collections import Mapping
+from collections.abc import Mapping
 from uuid import uuid1
 
 from django.utils import timezone

+ 2 - 2
src/sentry/db/models/fields/node.py

@@ -1,7 +1,7 @@
-import collections
 import logging
 import pickle
 from base64 import b64encode
+from collections.abc import MutableMapping
 from uuid import uuid4
 
 from django.db.models.signals import post_delete
@@ -23,7 +23,7 @@ class NodeIntegrityFailure(Exception):
     pass
 
 
-class NodeData(collections.MutableMapping):
+class NodeData(MutableMapping):
     """
     A wrapper for nodestore data that fetches the underlying data
     from nodestore.

+ 1 - 1
src/sentry/mediators/project_rules/creator.py

@@ -1,4 +1,4 @@
-from collections import Iterable
+from collections.abc import Iterable
 
 from sentry.mediators import Mediator, Param
 from sentry.models import Actor, Rule

+ 1 - 1
src/sentry/mediators/project_rules/updater.py

@@ -1,4 +1,4 @@
-from collections import Iterable
+from collections.abc import Iterable
 
 from sentry.mediators import Mediator, Param
 from sentry.mediators.param import if_param

+ 1 - 1
src/sentry/mediators/sentry_apps/creator.py

@@ -1,4 +1,4 @@
-from collections import Iterable
+from collections.abc import Iterable
 
 from django.db import IntegrityError, transaction
 from rest_framework.serializers import ValidationError

+ 1 - 1
src/sentry/mediators/sentry_apps/internal_creator.py

@@ -1,4 +1,4 @@
-from collections import Iterable
+from collections.abc import Iterable
 
 from sentry.mediators import Mediator, Param
 from sentry.mediators.sentry_app_installation_tokens import (

+ 1 - 1
src/sentry/mediators/sentry_apps/updater.py

@@ -1,4 +1,4 @@
-from collections import Iterable
+from collections.abc import Iterable
 
 from django.db.models import Q
 from django.utils import timezone

+ 1 - 1
src/sentry/mediators/service_hooks/creator.py

@@ -1,4 +1,4 @@
-from collections import Iterable
+from collections.abc import Iterable
 from itertools import chain
 
 from sentry.mediators import Mediator, Param

+ 1 - 1
src/sentry/mediators/service_hooks/updater.py

@@ -1,4 +1,4 @@
-from collections import Iterable
+from collections.abc import Iterable
 
 from sentry.mediators import Mediator, Param
 from sentry.mediators.param import if_param

Some files were not shown because too many files changed in this diff