Skip to content

Commit b1c976d

Browse files
authored
Chore Bumping all the dev dependencies to latest versions (#540)
* Bump black to 25.1.0 and run make check * Bump flake8 to 7.1.2 * Bump isort to 6.0.1 * Running make check with new isort * Bump mypy to 1.15 * Moving mypy config to pyproject.toml * Fix new mypy errors * mypy disallow_incomplete_defs = true * Bump sphinx-argparse to 0.5.2 * Fix Sphinx make docs warnings * Fix moved intersphinx url for yarl and multidict
1 parent c6937eb commit b1c976d

File tree

69 files changed

+621
-348
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+621
-348
lines changed

Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ tests_websockets:
2424
pytest tests --websockets-only
2525

2626
check:
27-
isort --recursive $(SRC_PYTHON)
27+
isort $(SRC_PYTHON)
2828
black $(SRC_PYTHON)
2929
flake8 $(SRC_PYTHON)
3030
mypy $(SRC_PYTHON)

docs/code_examples/aiohttp_async_dsl.py

+2
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ async def main():
1717
# GQL will fetch the schema just after the establishment of the first session
1818
async with client as session:
1919

20+
assert client.schema is not None
21+
2022
# Instantiate the root of the DSL Schema as ds
2123
ds = DSLSchema(client.schema)
2224

docs/code_examples/console_async.py

+7-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
import asyncio
22
import logging
3+
from typing import Optional
34

45
from aioconsole import ainput
6+
57
from gql import Client, gql
8+
from gql.client import AsyncClientSession
69
from gql.transport.aiohttp import AIOHTTPTransport
710

811
logging.basicConfig(level=logging.INFO)
@@ -21,7 +24,7 @@ def __init__(self):
2124
self._client = Client(
2225
transport=AIOHTTPTransport(url="https://countries.trevorblades.com/")
2326
)
24-
self._session = None
27+
self._session: Optional[AsyncClientSession] = None
2528

2629
self.get_continent_name_query = gql(GET_CONTINENT_NAME)
2730

@@ -34,11 +37,13 @@ async def close(self):
3437
async def get_continent_name(self, code):
3538
params = {"code": code}
3639

40+
assert self._session is not None
41+
3742
answer = await self._session.execute(
3843
self.get_continent_name_query, variable_values=params
3944
)
4045

41-
return answer.get("continent").get("name")
46+
return answer.get("continent").get("name") # type: ignore
4247

4348

4449
async def main():

docs/code_examples/fastapi_async.py

+2
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
from fastapi.responses import HTMLResponse
1313

1414
from gql import Client, gql
15+
from gql.client import ReconnectingAsyncClientSession
1516
from gql.transport.aiohttp import AIOHTTPTransport
1617

1718
logging.basicConfig(level=logging.DEBUG)
@@ -91,6 +92,7 @@ async def get_continent(continent_code):
9192
raise HTTPException(status_code=404, detail="Continent not found")
9293

9394
try:
95+
assert isinstance(client.session, ReconnectingAsyncClientSession)
9496
result = await client.session.execute(
9597
query, variable_values={"code": continent_code}
9698
)

docs/conf.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -83,11 +83,11 @@
8383
intersphinx_mapping = {
8484
'aiohttp': ('https://docs.aiohttp.org/en/stable/', None),
8585
'graphql': ('https://graphql-core-3.readthedocs.io/en/latest/', None),
86-
'multidict': ('https://multidict.readthedocs.io/en/stable/', None),
86+
'multidict': ('https://multidict.aio-libs.org/en/stable/', None),
8787
'python': ('https://docs.python.org/3/', None),
8888
'requests': ('https://requests.readthedocs.io/en/latest/', None),
8989
'websockets': ('https://websockets.readthedocs.io/en/11.0.3/', None),
90-
'yarl': ('https://yarl.readthedocs.io/en/stable/', None),
90+
'yarl': ('https://yarl.aio-libs.org/en/stable/', None),
9191
}
9292

9393
nitpick_ignore = [
@@ -100,6 +100,8 @@
100100
('py:class', 'asyncio.locks.Event'),
101101

102102
# aiohttp: should be fixed
103+
# See issue: https://github.com/aio-libs/aiohttp/issues/10468
104+
('py:class', 'aiohttp.client.ClientSession'),
103105
('py:class', 'aiohttp.client_reqrep.Fingerprint'),
104106
('py:class', 'aiohttp.helpers.BasicAuth'),
105107

docs/modules/gql.rst

+5-1
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,15 @@ Sub-Packages
2424
transport_aiohttp_websockets
2525
transport_appsync_auth
2626
transport_appsync_websockets
27+
transport_common_base
28+
transport_common_adapters_connection
29+
transport_common_adapters_aiohttp
30+
transport_common_adapters_websockets
2731
transport_exceptions
2832
transport_phoenix_channel_websockets
2933
transport_requests
3034
transport_httpx
3135
transport_websockets
32-
transport_websockets_base
36+
transport_websockets_protocol
3337
dsl
3438
utilities
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
gql.transport.common.adapters.aiohttp
2+
=====================================
3+
4+
.. currentmodule:: gql.transport.common.adapters.aiohttp
5+
6+
.. automodule:: gql.transport.common.adapters.aiohttp
7+
:member-order: bysource
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
gql.transport.common.adapters.connection
2+
========================================
3+
4+
.. currentmodule:: gql.transport.common.adapters.connection
5+
6+
.. automodule:: gql.transport.common.adapters.connection
7+
:member-order: bysource
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
gql.transport.common.adapters.websockets
2+
========================================
3+
4+
.. currentmodule:: gql.transport.common.adapters.websockets
5+
6+
.. automodule:: gql.transport.common.adapters.websockets
7+
:member-order: bysource
+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
gql.transport.common.base
2+
=========================
3+
4+
.. currentmodule:: gql.transport.common.base
5+
6+
.. automodule:: gql.transport.common.base
7+
:member-order: bysource

docs/modules/transport_websockets_base.rst

-7
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
gql.transport.websockets_protocol
2+
=================================
3+
4+
.. currentmodule:: gql.transport.websockets_protocol
5+
6+
.. automodule:: gql.transport.websockets_protocol
7+
:member-order: bysource

gql/cli.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -391,9 +391,10 @@ def get_transport(args: Namespace) -> Optional[AsyncTransport]:
391391
auth = AppSyncJWTAuthentication(host=url.host, jwt=args.jwt)
392392

393393
else:
394-
from gql.transport.appsync_auth import AppSyncIAMAuthentication
395394
from botocore.exceptions import NoRegionError
396395

396+
from gql.transport.appsync_auth import AppSyncIAMAuthentication
397+
397398
try:
398399
auth = AppSyncIAMAuthentication(host=url.host)
399400
except NoRegionError:

0 commit comments

Comments
 (0)