Skip to content

Commit 483053f

Browse files
authored
chore Fix docs sphinx nitpick warnings - adding intersphinx_mapping (#515)
1 parent 5879e23 commit 483053f

File tree

7 files changed

+60
-9
lines changed

7 files changed

+60
-9
lines changed

docs/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
# You can set these variables from the command line, and also
55
# from the environment for the first two.
6-
SPHINXOPTS ?=
6+
SPHINXOPTS ?= -n
77
SPHINXBUILD ?= sphinx-build
88
SOURCEDIR = .
99
BUILDDIR = _build

docs/code_examples/fastapi_async.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
from fastapi import FastAPI, HTTPException
1212
from fastapi.responses import HTMLResponse
13+
1314
from gql import Client, gql
1415
from gql.transport.aiohttp import AIOHTTPTransport
1516

docs/conf.py

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
extensions = [
3535
'sphinxarg.ext',
3636
'sphinx.ext.autodoc',
37+
'sphinx.ext.intersphinx',
3738
'sphinx_rtd_theme'
3839
]
3940

@@ -77,3 +78,52 @@
7778
'show-inheritance': True
7879
}
7980
autosummary_generate = True
81+
82+
# -- Intersphinx configuration ---------------------------------------------
83+
intersphinx_mapping = {
84+
'aiohttp': ('https://docs.aiohttp.org/en/stable/', None),
85+
'graphql': ('https://graphql-core-3.readthedocs.io/en/latest/', None),
86+
'multidict': ('https://multidict.readthedocs.io/en/stable/', None),
87+
'python': ('https://docs.python.org/3/', None),
88+
'requests': ('https://requests.readthedocs.io/en/latest/', None),
89+
'websockets': ('https://websockets.readthedocs.io/en/11.0.3/', None),
90+
'yarl': ('https://yarl.readthedocs.io/en/stable/', None),
91+
}
92+
93+
nitpick_ignore = [
94+
# graphql-core: should be fixed
95+
('py:class', 'graphql.execution.execute.ExecutionResult'),
96+
('py:class', 'Source'),
97+
('py:class', 'GraphQLSchema'),
98+
99+
# asyncio: should be fixed
100+
('py:class', 'asyncio.locks.Event'),
101+
102+
# aiohttp: should be fixed
103+
('py:class', 'aiohttp.client_reqrep.Fingerprint'),
104+
('py:class', 'aiohttp.helpers.BasicAuth'),
105+
106+
# multidict: should be fixed
107+
('py:class', 'multidict._multidict.CIMultiDictProxy'),
108+
('py:class', 'multidict._multidict.CIMultiDict'),
109+
('py:class', 'multidict._multidict.istr'),
110+
111+
# websockets: first bump websockets version
112+
('py:class', 'websockets.datastructures.SupportsKeysAndGetItem'),
113+
('py:class', 'websockets.typing.Subprotocol'),
114+
115+
# httpx: no sphinx docs yet https://github.com/encode/httpx/discussions/3091
116+
('py:class', 'httpx.AsyncClient'),
117+
('py:class', 'httpx.Client'),
118+
('py:class', 'httpx.Headers'),
119+
120+
# botocore: no sphinx docs
121+
('py:class', 'botocore.auth.BaseSigner'),
122+
('py:class', 'botocore.awsrequest.AWSRequest'),
123+
('py:class', 'botocore.credentials.Credentials'),
124+
('py:class', 'botocore.session.Session'),
125+
126+
# gql: ignore private classes
127+
('py:class', 'gql.transport.httpx._HTTPXTransport'),
128+
('py:class', 'gql.client._CallableT'),
129+
]

gql/dsl.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@ def select(
347347
:type \**fields_with_alias: DSLSelectable
348348
349349
:raises TypeError: if an argument is not an instance of :class:`DSLSelectable`
350-
:raises GraphQLError: if an argument is not a valid field
350+
:raises graphql.error.GraphQLError: if an argument is not a valid field
351351
"""
352352
# Concatenate fields without and with alias
353353
added_fields: Tuple["DSLSelectable", ...] = DSLField.get_aliased_fields(

gql/gql.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ def gql(request_string: str | Source) -> DocumentNode:
1313
:class:`async session <gql.client.AsyncClientSession>` or by a
1414
:class:`sync session <gql.client.SyncClientSession>`
1515
16-
:raises GraphQLError: if a syntax error is encountered.
16+
:raises graphql.error.GraphQLError: if a syntax error is encountered.
1717
"""
1818
if isinstance(request_string, Source):
1919
source = request_string

gql/transport/appsync_auth.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ class AppSyncAuthentication(ABC):
1818
"""AWS authentication abstract base class
1919
2020
All AWS authentication class should have a
21-
:meth:`get_headers <gql.transport.appsync.AppSyncAuthentication.get_headers>`
21+
:meth:`get_headers <gql.transport.appsync_auth.AppSyncAuthentication.get_headers>`
2222
method which defines the headers used in the authentication process."""
2323

2424
def get_auth_url(self, url: str) -> str:
@@ -91,7 +91,7 @@ class AppSyncIAMAuthentication(AppSyncAuthentication):
9191
9292
.. note::
9393
There is no need for you to use this class directly, you could instead
94-
intantiate the :class:`gql.transport.appsync.AppSyncWebsocketsTransport`
94+
intantiate :class:`gql.transport.appsync_websockets.AppSyncWebsocketsTransport`
9595
without an auth argument.
9696
9797
During initialization, this class will use botocore to attempt to

gql/transport/requests.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,10 @@ def __init__(
5454
"""Initialize the transport with the given request parameters.
5555
5656
:param url: The GraphQL server URL.
57-
:param headers: Dictionary of HTTP Headers to send with the :class:`Request`
58-
(Default: None).
59-
:param cookies: Dict or CookieJar object to send with the :class:`Request`
60-
(Default: None).
57+
:param headers: Dictionary of HTTP Headers to send with
58+
:meth:`requests.Session.request` (Default: None).
59+
:param cookies: Dict or CookieJar object to send with
60+
:meth:`requests.Session.request` (Default: None).
6161
:param auth: Auth tuple or callable to enable Basic/Digest/Custom HTTP Auth
6262
(Default: None).
6363
:param use_json: Send request body as JSON instead of form-urlencoded

0 commit comments

Comments
 (0)