Skip to content

Chore Bumping all the dev dependencies to latest versions #540

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 13 commits into from
Mar 12, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ tests_websockets:
pytest tests --websockets-only

check:
isort --recursive $(SRC_PYTHON)
isort $(SRC_PYTHON)
black $(SRC_PYTHON)
flake8 $(SRC_PYTHON)
mypy $(SRC_PYTHON)
Expand Down
2 changes: 2 additions & 0 deletions docs/code_examples/aiohttp_async_dsl.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ async def main():
# GQL will fetch the schema just after the establishment of the first session
async with client as session:

assert client.schema is not None

# Instantiate the root of the DSL Schema as ds
ds = DSLSchema(client.schema)

Expand Down
9 changes: 7 additions & 2 deletions docs/code_examples/console_async.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
import asyncio
import logging
from typing import Optional

from aioconsole import ainput

from gql import Client, gql
from gql.client import AsyncClientSession
from gql.transport.aiohttp import AIOHTTPTransport

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

self.get_continent_name_query = gql(GET_CONTINENT_NAME)

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

assert self._session is not None

answer = await self._session.execute(
self.get_continent_name_query, variable_values=params
)

return answer.get("continent").get("name")
return answer.get("continent").get("name") # type: ignore


async def main():
Expand Down
2 changes: 2 additions & 0 deletions docs/code_examples/fastapi_async.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
from fastapi.responses import HTMLResponse

from gql import Client, gql
from gql.client import ReconnectingAsyncClientSession
from gql.transport.aiohttp import AIOHTTPTransport

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

try:
assert isinstance(client.session, ReconnectingAsyncClientSession)
result = await client.session.execute(
query, variable_values={"code": continent_code}
)
Expand Down
6 changes: 4 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,11 @@
intersphinx_mapping = {
'aiohttp': ('https://docs.aiohttp.org/en/stable/', None),
'graphql': ('https://graphql-core-3.readthedocs.io/en/latest/', None),
'multidict': ('https://multidict.readthedocs.io/en/stable/', None),
'multidict': ('https://multidict.aio-libs.org/en/stable/', None),
'python': ('https://docs.python.org/3/', None),
'requests': ('https://requests.readthedocs.io/en/latest/', None),
'websockets': ('https://websockets.readthedocs.io/en/11.0.3/', None),
'yarl': ('https://yarl.readthedocs.io/en/stable/', None),
'yarl': ('https://yarl.aio-libs.org/en/stable/', None),
}

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

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

Expand Down
6 changes: 5 additions & 1 deletion docs/modules/gql.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,15 @@ Sub-Packages
transport_aiohttp_websockets
transport_appsync_auth
transport_appsync_websockets
transport_common_base
transport_common_adapters_connection
transport_common_adapters_aiohttp
transport_common_adapters_websockets
transport_exceptions
transport_phoenix_channel_websockets
transport_requests
transport_httpx
transport_websockets
transport_websockets_base
transport_websockets_protocol
dsl
utilities
7 changes: 7 additions & 0 deletions docs/modules/transport_common_adapters_aiohttp.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
gql.transport.common.adapters.aiohttp
=====================================

.. currentmodule:: gql.transport.common.adapters.aiohttp

.. automodule:: gql.transport.common.adapters.aiohttp
:member-order: bysource
7 changes: 7 additions & 0 deletions docs/modules/transport_common_adapters_connection.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
gql.transport.common.adapters.connection
========================================

.. currentmodule:: gql.transport.common.adapters.connection

.. automodule:: gql.transport.common.adapters.connection
:member-order: bysource
7 changes: 7 additions & 0 deletions docs/modules/transport_common_adapters_websockets.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
gql.transport.common.adapters.websockets
========================================

.. currentmodule:: gql.transport.common.adapters.websockets

.. automodule:: gql.transport.common.adapters.websockets
:member-order: bysource
7 changes: 7 additions & 0 deletions docs/modules/transport_common_base.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
gql.transport.common.base
=========================

.. currentmodule:: gql.transport.common.base

.. automodule:: gql.transport.common.base
:member-order: bysource
7 changes: 0 additions & 7 deletions docs/modules/transport_websockets_base.rst

This file was deleted.

7 changes: 7 additions & 0 deletions docs/modules/transport_websockets_protocol.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
gql.transport.websockets_protocol
=================================

.. currentmodule:: gql.transport.websockets_protocol

.. automodule:: gql.transport.websockets_protocol
:member-order: bysource
3 changes: 2 additions & 1 deletion gql/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -391,9 +391,10 @@ def get_transport(args: Namespace) -> Optional[AsyncTransport]:
auth = AppSyncJWTAuthentication(host=url.host, jwt=args.jwt)

else:
from gql.transport.appsync_auth import AppSyncIAMAuthentication
from botocore.exceptions import NoRegionError

from gql.transport.appsync_auth import AppSyncIAMAuthentication

try:
auth = AppSyncIAMAuthentication(host=url.host)
except NoRegionError:
Expand Down
Loading
Loading