diff options
author | Andrew Morgan <andrew@amorgan.xyz> | 2020-02-14 13:17:02 +0000 |
---|---|---|
committer | Andrew Morgan <andrew@amorgan.xyz> | 2020-02-14 14:27:12 +0000 |
commit | 622d0be1b303eaca3df917fe89b7355c559dccec (patch) | |
tree | 47b57db8a5fd81ea0e9e6350ae8532acc335295a | |
parent | Delete duplicate user deactivation (diff) | |
download | synapse-622d0be1b303eaca3df917fe89b7355c559dccec.tar.xz |
Fix with isort==4.3.21 and black==19.3b0
-rw-r--r-- | docs/sphinx/conf.py | 8 | ||||
-rw-r--r-- | synapse/handlers/pagination.py | 2 | ||||
-rw-r--r-- | synapse/handlers/profile.py | 3 | ||||
-rw-r--r-- | synapse/handlers/room_member.py | 6 | ||||
-rw-r--r-- | synapse/http/client.py | 2 | ||||
-rw-r--r-- | synapse/rest/client/v2_alpha/account_validity.py | 7 | ||||
-rw-r--r-- | synapse/server.py | 2 | ||||
-rw-r--r-- | synapse/server_notices/server_notices_sender.py | 2 | ||||
-rw-r--r-- | synapse/storage/events_worker.py | 2 | ||||
-rw-r--r-- | tests/handlers/test_register.py | 4 | ||||
-rw-r--r-- | tests/server_notices/test_resource_limits_server_notices.py | 2 | ||||
-rw-r--r-- | tests/storage/test_keys.py | 1 | ||||
-rw-r--r-- | tox.ini | 2 |
13 files changed, 19 insertions, 24 deletions
diff --git a/docs/sphinx/conf.py b/docs/sphinx/conf.py index ca4b879526..5c5a115ca9 100644 --- a/docs/sphinx/conf.py +++ b/docs/sphinx/conf.py @@ -12,8 +12,8 @@ # All configuration values have a default; values that are commented out # serve to show the default. -import sys import os +import sys # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the @@ -191,11 +191,11 @@ htmlhelp_basename = "Synapsedoc" latex_elements = { # The paper size ('letterpaper' or 'a4paper'). - #'papersize': 'letterpaper', + # 'papersize': 'letterpaper', # The font size ('10pt', '11pt' or '12pt'). - #'pointsize': '10pt', + # 'pointsize': '10pt', # Additional stuff for the LaTeX preamble. - #'preamble': '', + # 'preamble': '', } # Grouping the document tree into LaTeX files. List of tuples diff --git a/synapse/handlers/pagination.py b/synapse/handlers/pagination.py index bc9c9a056f..1d1fe8996d 100644 --- a/synapse/handlers/pagination.py +++ b/synapse/handlers/pagination.py @@ -22,8 +22,8 @@ from twisted.python.failure import Failure from synapse.api.constants import EventTypes, Membership from synapse.api.errors import SynapseError -from synapse.metrics.background_process_metrics import run_as_background_process from synapse.logging.context import run_in_background +from synapse.metrics.background_process_metrics import run_as_background_process from synapse.storage.state import StateFilter from synapse.types import RoomStreamToken from synapse.util.async_helpers import ReadWriteLock diff --git a/synapse/handlers/profile.py b/synapse/handlers/profile.py index e439294ddf..7dfdce9757 100644 --- a/synapse/handlers/profile.py +++ b/synapse/handlers/profile.py @@ -17,7 +17,6 @@ import logging from six import raise_from - from six.moves import range from signedjson.sign import sign_json @@ -32,9 +31,9 @@ from synapse.api.errors import ( StoreError, SynapseError, ) +from synapse.logging.context import run_in_background from synapse.metrics.background_process_metrics import run_as_background_process from synapse.types import UserID, get_domain_from_id -from synapse.logging.context import run_in_background from ._base import BaseHandler diff --git a/synapse/handlers/room_member.py b/synapse/handlers/room_member.py index 0a2ff75629..2f52f2a8f2 100644 --- a/synapse/handlers/room_member.py +++ b/synapse/handlers/room_member.py @@ -599,9 +599,9 @@ class RoomMemberHandler(object): if requester is not None: sender = UserID.from_string(event.sender) - assert sender == requester.user, ( - "Sender (%s) must be same as requester (%s)" % (sender, requester.user) - ) + assert ( + sender == requester.user + ), "Sender (%s) must be same as requester (%s)" % (sender, requester.user) assert self.hs.is_mine(sender), "Sender must be our own: %s" % (sender,) else: requester = synapse.types.create_requester(target_user) diff --git a/synapse/http/client.py b/synapse/http/client.py index e58ecc6786..e498ba0a6c 100644 --- a/synapse/http/client.py +++ b/synapse/http/client.py @@ -45,8 +45,8 @@ from synapse.http import ( cancelled_to_request_timed_out_error, redact_uri, ) -from synapse.logging.context import make_deferred_yieldable from synapse.http.proxyagent import ProxyAgent +from synapse.logging.context import make_deferred_yieldable from synapse.util.async_helpers import timeout_deferred from synapse.util.caches import CACHE_SIZE_FACTOR diff --git a/synapse/rest/client/v2_alpha/account_validity.py b/synapse/rest/client/v2_alpha/account_validity.py index 348d2a103b..77a59461bc 100644 --- a/synapse/rest/client/v2_alpha/account_validity.py +++ b/synapse/rest/client/v2_alpha/account_validity.py @@ -15,9 +15,10 @@ import logging -from twisted.internet import defer from six import ensure_binary +from twisted.internet import defer + from synapse.api.errors import AuthError, SynapseError from synapse.http.server import finish_request from synapse.http.servlet import RestServlet @@ -65,9 +66,7 @@ class AccountValidityRenewServlet(RestServlet): request.setResponseCode(status_code) request.setHeader(b"Content-Type", b"text/html; charset=utf-8") - request.setHeader( - b"Content-Length", b"%d" % (len(response),) - ) + request.setHeader(b"Content-Length", b"%d" % (len(response),)) request.write(ensure_binary(response)) finish_request(request) defer.returnValue(None) diff --git a/synapse/server.py b/synapse/server.py index 8aa572d289..23be3560fa 100644 --- a/synapse/server.py +++ b/synapse/server.py @@ -94,7 +94,7 @@ from synapse.secrets import Secrets from synapse.server_notices.server_notices_manager import ServerNoticesManager from synapse.server_notices.server_notices_sender import ServerNoticesSender from synapse.server_notices.worker_server_notices_sender import ( - WorkerServerNoticesSender + WorkerServerNoticesSender, ) from synapse.state import StateHandler, StateResolutionHandler from synapse.streams.events import EventSources diff --git a/synapse/server_notices/server_notices_sender.py b/synapse/server_notices/server_notices_sender.py index ceff6c8e02..652bab58e3 100644 --- a/synapse/server_notices/server_notices_sender.py +++ b/synapse/server_notices/server_notices_sender.py @@ -16,7 +16,7 @@ from twisted.internet import defer from synapse.server_notices.consent_server_notices import ConsentServerNotices from synapse.server_notices.resource_limits_server_notices import ( - ResourceLimitsServerNotices + ResourceLimitsServerNotices, ) diff --git a/synapse/storage/events_worker.py b/synapse/storage/events_worker.py index 280f2297b9..bd3ebddcd8 100644 --- a/synapse/storage/events_worker.py +++ b/synapse/storage/events_worker.py @@ -27,8 +27,6 @@ from synapse.api.constants import EventTypes from synapse.api.errors import NotFoundError from synapse.api.room_versions import EventFormatVersions from synapse.events import FrozenEvent, event_type_from_format_version # noqa: F401 - -# these are only included to make the type annotations work from synapse.events.snapshot import EventContext # noqa: F401 from synapse.events.utils import prune_event from synapse.logging.context import ( diff --git a/tests/handlers/test_register.py b/tests/handlers/test_register.py index e5a9acd87f..2a60e81cbf 100644 --- a/tests/handlers/test_register.py +++ b/tests/handlers/test_register.py @@ -246,8 +246,8 @@ class RegistrationTestCase(unittest.HomeserverTestCase): # Multibyte unicode characters self._check_mapping( - u"j\u030a\u0065an-poppy.seed@example.com", - u"J\u030a\u0065an-Poppy Seed [Example]", + "j\u030a\u0065an-poppy.seed@example.com", + "J\u030a\u0065an-Poppy Seed [Example]", ) def _check_mapping(self, i, expected): diff --git a/tests/server_notices/test_resource_limits_server_notices.py b/tests/server_notices/test_resource_limits_server_notices.py index e1e0c3184d..984feb623f 100644 --- a/tests/server_notices/test_resource_limits_server_notices.py +++ b/tests/server_notices/test_resource_limits_server_notices.py @@ -20,7 +20,7 @@ from twisted.internet import defer from synapse.api.constants import EventTypes, ServerNoticeMsgType from synapse.api.errors import ResourceLimitError from synapse.server_notices.resource_limits_server_notices import ( - ResourceLimitsServerNotices + ResourceLimitsServerNotices, ) from tests import unittest diff --git a/tests/storage/test_keys.py b/tests/storage/test_keys.py index cef2112974..95f309fbbc 100644 --- a/tests/storage/test_keys.py +++ b/tests/storage/test_keys.py @@ -128,4 +128,3 @@ class KeyStoreTestCase(tests.unittest.HomeserverTestCase): res2 = res[("srv1", key_id_2)] self.assertEqual(res2.verify_key, new_key_2) self.assertEqual(res2.valid_until_ts, 300) - diff --git a/tox.ini b/tox.ini index 5b8a8b3c8e..6b5190e810 100644 --- a/tox.ini +++ b/tox.ini @@ -117,7 +117,7 @@ skip_install = True basepython = python3.6 deps = flake8 - black + black==18.6b4 commands = python -m black --check --diff . /bin/sh -c "flake8 synapse tests scripts scripts-dev scripts/hash_password scripts/register_new_matrix_user scripts/synapse_port_db synctl {env:PEP8SUFFIX:}" |