Skip to content

Commit f0790ae

Browse files
authored
Update black dev dependency to 22.3.0 (#313)
1 parent fe213c4 commit f0790ae

37 files changed

+263
-114
lines changed

docs/code_examples/aiohttp_async.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ async def main():
1111
# Using `async with` on the client will start a connection on the transport
1212
# and provide a `session` variable to execute queries on this connection
1313
async with Client(
14-
transport=transport, fetch_schema_from_transport=True,
14+
transport=transport,
15+
fetch_schema_from_transport=True,
1516
) as session:
1617

1718
# Execute single query

docs/code_examples/appsync/mutation_api_key.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ async def main():
3131
transport = AIOHTTPTransport(url=url, auth=auth)
3232

3333
async with Client(
34-
transport=transport, fetch_schema_from_transport=False,
34+
transport=transport,
35+
fetch_schema_from_transport=False,
3536
) as session:
3637

3738
query = gql(

docs/code_examples/appsync/mutation_iam.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ async def main():
3030
transport = AIOHTTPTransport(url=url, auth=auth)
3131

3232
async with Client(
33-
transport=transport, fetch_schema_from_transport=False,
33+
transport=transport,
34+
fetch_schema_from_transport=False,
3435
) as session:
3536

3637
query = gql(

docs/code_examples/requests_sync.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22
from gql.transport.requests import RequestsHTTPTransport
33

44
transport = RequestsHTTPTransport(
5-
url="https://countries.trevorblades.com/", verify=True, retries=3,
5+
url="https://countries.trevorblades.com/",
6+
verify=True,
7+
retries=3,
68
)
79

810
client = Client(transport=transport, fetch_schema_from_transport=True)

docs/code_examples/requests_sync_dsl.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@
33
from gql.transport.requests import RequestsHTTPTransport
44

55
transport = RequestsHTTPTransport(
6-
url="https://countries.trevorblades.com/", verify=True, retries=3,
6+
url="https://countries.trevorblades.com/",
7+
verify=True,
8+
retries=3,
79
)
810

911
client = Client(transport=transport, fetch_schema_from_transport=True)

docs/code_examples/websockets_async.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ async def main():
1414
# Using `async with` on the client will start a connection on the transport
1515
# and provide a `session` variable to execute queries on this connection
1616
async with Client(
17-
transport=transport, fetch_schema_from_transport=True,
17+
transport=transport,
18+
fetch_schema_from_transport=True,
1819
) as session:
1920

2021
# Execute single query

gql/cli.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,11 +132,15 @@ def get_parser(with_examples: bool = False) -> ArgumentParser:
132132
appsync_auth_group = appsync_group.add_mutually_exclusive_group()
133133

134134
appsync_auth_group.add_argument(
135-
"--api-key", help="Provide an API key for authentication", dest="api_key",
135+
"--api-key",
136+
help="Provide an API key for authentication",
137+
dest="api_key",
136138
)
137139

138140
appsync_auth_group.add_argument(
139-
"--jwt", help="Provide an JSON Web token for authentication", dest="jwt",
141+
"--jwt",
142+
help="Provide an JSON Web token for authentication",
143+
dest="jwt",
140144
)
141145

142146
return parser

gql/dsl.py

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,9 @@ class DSLSelector(ABC):
311311
selection_set: SelectionSetNode
312312

313313
def __init__(
314-
self, *fields: "DSLSelectable", **fields_with_alias: "DSLSelectableWithAlias",
314+
self,
315+
*fields: "DSLSelectable",
316+
**fields_with_alias: "DSLSelectableWithAlias",
315317
):
316318
""":meta private:"""
317319
self.selection_set = SelectionSetNode(selections=())
@@ -326,7 +328,9 @@ def is_valid_field(self, field: "DSLSelectable") -> bool:
326328
) # pragma: no cover
327329

328330
def select(
329-
self, *fields: "DSLSelectable", **fields_with_alias: "DSLSelectableWithAlias",
331+
self,
332+
*fields: "DSLSelectable",
333+
**fields_with_alias: "DSLSelectableWithAlias",
330334
):
331335
r"""Select the fields which should be added.
332336
@@ -387,7 +391,9 @@ def executable_ast(self):
387391
) # pragma: no cover
388392

389393
def __init__(
390-
self, *fields: "DSLSelectable", **fields_with_alias: "DSLSelectableWithAlias",
394+
self,
395+
*fields: "DSLSelectable",
396+
**fields_with_alias: "DSLSelectableWithAlias",
391397
):
392398
r"""Given arguments of type :class:`DSLSelectable` containing GraphQL requests,
393399
generate an operation which can be converted to a Document
@@ -552,7 +558,9 @@ def get_ast_definitions(self) -> Tuple[VariableDefinitionNode, ...]:
552558
"""
553559
return tuple(
554560
VariableDefinitionNode(
555-
type=var.type, variable=var.ast_variable, default_value=None,
561+
type=var.type,
562+
variable=var.ast_variable,
563+
default_value=None,
556564
)
557565
for var in self.variables.values()
558566
if var.type is not None # only variables used
@@ -889,7 +897,9 @@ class DSLInlineFragment(DSLSelectable, DSLFragmentSelector):
889897
ast_field: InlineFragmentNode
890898

891899
def __init__(
892-
self, *fields: "DSLSelectable", **fields_with_alias: "DSLSelectableWithAlias",
900+
self,
901+
*fields: "DSLSelectable",
902+
**fields_with_alias: "DSLSelectableWithAlias",
893903
):
894904
r"""Initialize the DSLInlineFragment.
895905
@@ -944,7 +954,8 @@ class DSLFragment(DSLSelectable, DSLFragmentSelector, DSLExecutable):
944954
name: str
945955

946956
def __init__(
947-
self, name: str,
957+
self,
958+
name: str,
948959
):
949960
r"""Initialize the DSLFragment.
950961

gql/transport/aiohttp.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,8 @@ async def execute(
222222
# If we upload files, we will extract the files present in the
223223
# variable_values dict and replace them by null values
224224
nulled_variable_values, files = extract_files(
225-
variables=variable_values, file_classes=self.file_classes,
225+
variables=variable_values,
226+
file_classes=self.file_classes,
226227
)
227228

228229
# Save the nulled variable values in the payload
@@ -275,7 +276,8 @@ async def execute(
275276
# Add headers for AppSync if requested
276277
if isinstance(self.auth, AppSyncAuthentication):
277278
post_args["headers"] = self.auth.get_headers(
278-
json.dumps(payload), {"content-type": "application/json"},
279+
json.dumps(payload),
280+
{"content-type": "application/json"},
279281
)
280282

281283
if self.session is None:

gql/transport/appsync_websockets.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,12 @@ async def _send_query(
172172
"authorization": self.auth.get_headers(serialized_data)
173173
}
174174

175-
await self._send(json.dumps(message, separators=(",", ":"),))
175+
await self._send(
176+
json.dumps(
177+
message,
178+
separators=(",", ":"),
179+
)
180+
)
176181

177182
return query_id
178183

0 commit comments

Comments
 (0)