Bump black configuration to target py36 (#9781)

Signed-off-by: Dan Callahan <danc@element.io>
This commit is contained in:
Dan Callahan 2021-04-13 10:41:34 +01:00 committed by GitHub
parent 1fc97ee876
commit 1d5f0e3529
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 16 additions and 15 deletions

1
changelog.d/9781.misc Normal file
View file

@ -0,0 +1 @@
Update Black configuration to target Python 3.6.

View file

@ -35,7 +35,7 @@
showcontent = true showcontent = true
[tool.black] [tool.black]
target-version = ['py35'] target-version = ['py36']
exclude = ''' exclude = '''
( (

View file

@ -270,7 +270,7 @@ class TlsConfig(Config):
tls_certificate_path, tls_certificate_path,
tls_private_key_path, tls_private_key_path,
acme_domain, acme_domain,
**kwargs **kwargs,
): ):
"""If the acme_domain is specified acme will be enabled. """If the acme_domain is specified acme will be enabled.
If the TLS paths are not specified the default will be certs in the If the TLS paths are not specified the default will be certs in the

View file

@ -1071,7 +1071,7 @@ class PresenceEventSource:
room_ids=None, room_ids=None,
include_offline=True, include_offline=True,
explicit_room_id=None, explicit_room_id=None,
**kwargs **kwargs,
) -> Tuple[List[UserPresenceState], int]: ) -> Tuple[List[UserPresenceState], int]:
# The process for getting presence events are: # The process for getting presence events are:
# 1. Get the rooms the user is in. # 1. Get the rooms the user is in.

View file

@ -272,7 +272,7 @@ class MatrixFederationHttpClient:
self, self,
request: MatrixFederationRequest, request: MatrixFederationRequest,
try_trailing_slash_on_400: bool = False, try_trailing_slash_on_400: bool = False,
**send_request_args **send_request_args,
) -> IResponse: ) -> IResponse:
"""Wrapper for _send_request which can optionally retry the request """Wrapper for _send_request which can optionally retry the request
upon receiving a combination of a 400 HTTP response code and a upon receiving a combination of a 400 HTTP response code and a

View file

@ -497,7 +497,7 @@ class SynapseSite(Site):
resource, resource,
server_version_string, server_version_string,
*args, *args,
**kwargs **kwargs,
): ):
Site.__init__(self, resource, *args, **kwargs) Site.__init__(self, resource, *args, **kwargs)

View file

@ -488,7 +488,7 @@ class DatabasePool:
exception_callbacks: List[_CallbackListEntry], exception_callbacks: List[_CallbackListEntry],
func: "Callable[..., R]", func: "Callable[..., R]",
*args: Any, *args: Any,
**kwargs: Any **kwargs: Any,
) -> R: ) -> R:
"""Start a new database transaction with the given connection. """Start a new database transaction with the given connection.
@ -622,7 +622,7 @@ class DatabasePool:
func: "Callable[..., R]", func: "Callable[..., R]",
*args: Any, *args: Any,
db_autocommit: bool = False, db_autocommit: bool = False,
**kwargs: Any **kwargs: Any,
) -> R: ) -> R:
"""Starts a transaction on the database and runs a given function """Starts a transaction on the database and runs a given function
@ -682,7 +682,7 @@ class DatabasePool:
func: "Callable[..., R]", func: "Callable[..., R]",
*args: Any, *args: Any,
db_autocommit: bool = False, db_autocommit: bool = False,
**kwargs: Any **kwargs: Any,
) -> R: ) -> R:
"""Wraps the .runWithConnection() method on the underlying db_pool. """Wraps the .runWithConnection() method on the underlying db_pool.
@ -775,7 +775,7 @@ class DatabasePool:
desc: str, desc: str,
decoder: Optional[Callable[[Cursor], R]], decoder: Optional[Callable[[Cursor], R]],
query: str, query: str,
*args: Any *args: Any,
) -> R: ) -> R:
"""Runs a single query for a result set. """Runs a single query for a result set.

View file

@ -340,7 +340,7 @@ class SlavedEventStoreTestCase(BaseSlavedStoreTestCase):
prev_state: Optional[list] = None, prev_state: Optional[list] = None,
redacts=None, redacts=None,
push_actions: Iterable = frozenset(), push_actions: Iterable = frozenset(),
**content **content,
): ):
prev_events = prev_events or [] prev_events = prev_events or []
auth_events = auth_events or [] auth_events = auth_events or []

View file

@ -38,7 +38,7 @@ def create_event(
depth=2, depth=2,
event_id=None, event_id=None,
prev_events: Optional[List[str]] = None, prev_events: Optional[List[str]] = None,
**kwargs **kwargs,
): ):
global _next_event_id global _next_event_id

View file

@ -33,7 +33,7 @@ async def inject_member_event(
membership: str, membership: str,
target: Optional[str] = None, target: Optional[str] = None,
extra_content: Optional[dict] = None, extra_content: Optional[dict] = None,
**kwargs **kwargs,
) -> EventBase: ) -> EventBase:
"""Inject a membership event into a room.""" """Inject a membership event into a room."""
if target is None: if target is None:
@ -58,7 +58,7 @@ async def inject_event(
hs: synapse.server.HomeServer, hs: synapse.server.HomeServer,
room_version: Optional[str] = None, room_version: Optional[str] = None,
prev_event_ids: Optional[List[str]] = None, prev_event_ids: Optional[List[str]] = None,
**kwargs **kwargs,
) -> EventBase: ) -> EventBase:
"""Inject a generic event into a room """Inject a generic event into a room
@ -83,7 +83,7 @@ async def create_event(
hs: synapse.server.HomeServer, hs: synapse.server.HomeServer,
room_version: Optional[str] = None, room_version: Optional[str] = None,
prev_event_ids: Optional[List[str]] = None, prev_event_ids: Optional[List[str]] = None,
**kwargs **kwargs,
) -> Tuple[EventBase, EventContext]: ) -> Tuple[EventBase, EventContext]:
if room_version is None: if room_version is None:
room_version = await hs.get_datastore().get_room_version_id(kwargs["room_id"]) room_version = await hs.get_datastore().get_room_version_id(kwargs["room_id"])

View file

@ -190,7 +190,7 @@ def setup_test_homeserver(
config=None, config=None,
reactor=None, reactor=None,
homeserver_to_use: Type[HomeServer] = TestHomeServer, homeserver_to_use: Type[HomeServer] = TestHomeServer,
**kwargs **kwargs,
): ):
""" """
Setup a homeserver suitable for running tests against. Keyword arguments Setup a homeserver suitable for running tests against. Keyword arguments