diff --git a/synapse/api/filtering.py b/synapse/api/filtering.py index cd699ef27f..fc649eac7d 100644 --- a/synapse/api/filtering.py +++ b/synapse/api/filtering.py @@ -15,7 +15,7 @@ from synapse.api.errors import SynapseError from synapse.types import UserID, RoomID -import ujson as json +import json class Filtering(object): diff --git a/synapse/handlers/typing.py b/synapse/handlers/typing.py index 8ce27f49ec..adf4e4b3eb 100644 --- a/synapse/handlers/typing.py +++ b/synapse/handlers/typing.py @@ -25,7 +25,7 @@ from synapse.types import UserID import logging from collections import namedtuple -import ujson as json +import json logger = logging.getLogger(__name__) diff --git a/synapse/http/server.py b/synapse/http/server.py index b82196fd5e..481d53b425 100644 --- a/synapse/http/server.py +++ b/synapse/http/server.py @@ -34,7 +34,7 @@ from twisted.web.util import redirectTo import collections import logging import urllib -import ujson +import json logger = logging.getLogger(__name__) @@ -333,7 +333,7 @@ def respond_with_json(request, code, json_object, send_cors=False, json_bytes = encode_canonical_json(json_object) else: # ujson doesn't like frozen_dicts. - json_bytes = ujson.dumps(json_object, ensure_ascii=False) + json_bytes = json.dumps(json_object, ensure_ascii=False) return respond_with_json_bytes( request, code, json_bytes, diff --git a/synapse/push/bulk_push_rule_evaluator.py b/synapse/push/bulk_push_rule_evaluator.py index 76d7eb7ce0..1c4c805a9c 100644 --- a/synapse/push/bulk_push_rule_evaluator.py +++ b/synapse/push/bulk_push_rule_evaluator.py @@ -14,7 +14,7 @@ # limitations under the License. import logging -import ujson as json +import json from twisted.internet import defer diff --git a/synapse/python_dependencies.py b/synapse/python_dependencies.py index 0a6043ae8d..d81dccc2ed 100644 --- a/synapse/python_dependencies.py +++ b/synapse/python_dependencies.py @@ -32,9 +32,9 @@ REQUIREMENTS = { "py-bcrypt": ["bcrypt"], "pillow": ["PIL"], "pydenticon": ["pydenticon"], - "ujson": ["ujson"], - "blist": ["blist"], - "pysaml2>=3.0.0,<4.0.0": ["saml2>=3.0.0,<4.0.0"], + # "ujson": ["ujson"], # json + "sortedcontainers": ["sortedcontainers"], + "pysaml2==4.0.3": ["saml2==4.0.3"], "pymacaroons-pynacl": ["pymacaroons"], } CONDITIONAL_REQUIREMENTS = { diff --git a/synapse/replication/resource.py b/synapse/replication/resource.py index 8c1ae0fbc7..9298bcb28e 100644 --- a/synapse/replication/resource.py +++ b/synapse/replication/resource.py @@ -20,7 +20,7 @@ from twisted.web.resource import Resource from twisted.web.server import NOT_DONE_YET from twisted.internet import defer -import ujson as json +import json import collections import logging diff --git a/synapse/rest/client/v2_alpha/sync.py b/synapse/rest/client/v2_alpha/sync.py index de4a020ad4..28b0e854be 100644 --- a/synapse/rest/client/v2_alpha/sync.py +++ b/synapse/rest/client/v2_alpha/sync.py @@ -32,7 +32,7 @@ import copy import itertools import logging -import ujson as json +import json logger = logging.getLogger(__name__) diff --git a/synapse/storage/account_data.py b/synapse/storage/account_data.py index faddefe219..dda0518921 100644 --- a/synapse/storage/account_data.py +++ b/synapse/storage/account_data.py @@ -16,7 +16,7 @@ from ._base import SQLBaseStore from twisted.internet import defer -import ujson as json +import json import logging logger = logging.getLogger(__name__) diff --git a/synapse/storage/background_updates.py b/synapse/storage/background_updates.py index 49904046cf..d50e130fda 100644 --- a/synapse/storage/background_updates.py +++ b/synapse/storage/background_updates.py @@ -17,7 +17,7 @@ from ._base import SQLBaseStore from twisted.internet import defer -import ujson as json +import json import logging logger = logging.getLogger(__name__) diff --git a/synapse/storage/event_push_actions.py b/synapse/storage/event_push_actions.py index dc5830450a..28822f3b71 100644 --- a/synapse/storage/event_push_actions.py +++ b/synapse/storage/event_push_actions.py @@ -18,7 +18,7 @@ from twisted.internet import defer from synapse.util.caches.descriptors import cachedInlineCallbacks import logging -import ujson as json +import json logger = logging.getLogger(__name__) diff --git a/synapse/storage/events.py b/synapse/storage/events.py index 5233430028..178ef8f43b 100644 --- a/synapse/storage/events.py +++ b/synapse/storage/events.py @@ -28,7 +28,7 @@ from contextlib import contextmanager import logging import math -import ujson as json +import json logger = logging.getLogger(__name__) diff --git a/synapse/storage/receipts.py b/synapse/storage/receipts.py index 6b9d848eaa..83c873417c 100644 --- a/synapse/storage/receipts.py +++ b/synapse/storage/receipts.py @@ -20,7 +20,7 @@ from synapse.util.caches.stream_change_cache import StreamChangeCache from twisted.internet import defer import logging -import ujson as json +import json logger = logging.getLogger(__name__) diff --git a/synapse/storage/schema/delta/25/fts.py b/synapse/storage/schema/delta/25/fts.py index d3ff2b1779..84b65e95c1 100644 --- a/synapse/storage/schema/delta/25/fts.py +++ b/synapse/storage/schema/delta/25/fts.py @@ -17,7 +17,7 @@ import logging from synapse.storage.prepare_database import get_statements from synapse.storage.engines import PostgresEngine, Sqlite3Engine -import ujson +import json logger = logging.getLogger(__name__) @@ -66,7 +66,7 @@ def run_upgrade(cur, database_engine, *args, **kwargs): "max_stream_id_exclusive": max_stream_id + 1, "rows_inserted": 0, } - progress_json = ujson.dumps(progress) + progress_json = json.dumps(progress) sql = ( "INSERT into background_updates (update_name, progress_json)" diff --git a/synapse/storage/schema/delta/27/ts.py b/synapse/storage/schema/delta/27/ts.py index f8c16391a2..a2cf059aaf 100644 --- a/synapse/storage/schema/delta/27/ts.py +++ b/synapse/storage/schema/delta/27/ts.py @@ -16,7 +16,7 @@ import logging from synapse.storage.prepare_database import get_statements -import ujson +import json logger = logging.getLogger(__name__) @@ -45,7 +45,7 @@ def run_upgrade(cur, database_engine, *args, **kwargs): "max_stream_id_exclusive": max_stream_id + 1, "rows_inserted": 0, } - progress_json = ujson.dumps(progress) + progress_json = json.dumps(progress) sql = ( "INSERT into background_updates (update_name, progress_json)" diff --git a/synapse/storage/tags.py b/synapse/storage/tags.py index a0e6b42b30..e93688b583 100644 --- a/synapse/storage/tags.py +++ b/synapse/storage/tags.py @@ -17,7 +17,7 @@ from ._base import SQLBaseStore from synapse.util.caches.descriptors import cached from twisted.internet import defer -import ujson as json +import json import logging logger = logging.getLogger(__name__) diff --git a/synapse/util/caches/stream_change_cache.py b/synapse/util/caches/stream_change_cache.py index ea8a74ca69..147b79d848 100644 --- a/synapse/util/caches/stream_change_cache.py +++ b/synapse/util/caches/stream_change_cache.py @@ -16,7 +16,7 @@ from synapse.util.caches import cache_counter, caches_by_name -from blist import sorteddict +from sortedcontainers import SortedDict as sorteddict import logging import os diff --git a/tox.ini b/tox.ini index 757b7189c3..0e339ec848 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = packaging, py27, pep8 +envlist = packaging, py27, pypy, pep8 [testenv] deps =