mirror of
https://github.com/element-hq/synapse.git
synced 2024-12-14 11:57:44 +00:00
Support PyPy
This commit is contained in:
parent
5fbdf2bcec
commit
06602461e7
17 changed files with 22 additions and 22 deletions
|
@ -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):
|
||||
|
|
|
@ -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__)
|
||||
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
# limitations under the License.
|
||||
|
||||
import logging
|
||||
import ujson as json
|
||||
import json
|
||||
|
||||
from twisted.internet import defer
|
||||
|
||||
|
|
|
@ -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 = {
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -32,7 +32,7 @@ import copy
|
|||
import itertools
|
||||
import logging
|
||||
|
||||
import ujson as json
|
||||
import json
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
|
|
@ -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__)
|
||||
|
|
|
@ -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__)
|
||||
|
|
|
@ -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__)
|
||||
|
||||
|
|
|
@ -28,7 +28,7 @@ from contextlib import contextmanager
|
|||
|
||||
import logging
|
||||
import math
|
||||
import ujson as json
|
||||
import json
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
|
|
@ -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__)
|
||||
|
|
|
@ -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)"
|
||||
|
|
|
@ -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)"
|
||||
|
|
|
@ -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__)
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
2
tox.ini
2
tox.ini
|
@ -1,5 +1,5 @@
|
|||
[tox]
|
||||
envlist = packaging, py27, pep8
|
||||
envlist = packaging, py27, pypy, pep8
|
||||
|
||||
[testenv]
|
||||
deps =
|
||||
|
|
Loading…
Reference in a new issue