Skip to content

Commit 98e78d6

Browse files
committed
Update Sphinx
1 parent b668e47 commit 98e78d6

File tree

5 files changed

+19
-7
lines changed

5 files changed

+19
-7
lines changed

docs/conf.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,10 @@
9595
}
9696
autosummary_generate = True
9797

98+
autodoc_type_aliases = {
99+
'AwaitableOrValue': 'graphql.pyutils.AwaitableOrValue'
100+
}
101+
98102
# GraphQL-core top level modules with submodules that can be omitted.
99103
# Sometimes autodoc cannot find classes since it is looking for the
100104
# qualified form, but the documentation has the shorter form.
@@ -145,6 +149,14 @@ def on_missing_reference(app, env, node, contnode):
145149
if target in ignore_references:
146150
return contnode
147151
typ = node.get('reftype')
152+
if typ == 'obj':
153+
# workaround for https://github.com/sphinx-doc/sphinx/issues/8818
154+
if target in ('Any', 'Optional', 'Union'):
155+
return contnode
156+
base_module, target = target.split('.', 1)
157+
name = target.rsplit('.', 1)[-1]
158+
if name in ('T', 'GT', 'GNT', 'KT', 'VT'):
159+
return contnode
148160
if typ != 'class':
149161
return None
150162
if '.' in target: # maybe too specific

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ black = "20.8b1"
4242
flake8 = "^3.8"
4343
mypy = "0.782"
4444
codecov = "^2"
45-
sphinx = "^3.2"
45+
sphinx = "^3.4"
4646
sphinx_rtd_theme = ">=0.5,<1"
4747
check-manifest = "0.40"
4848
bump2version = ">=1.0,<2"

src/graphql/pyutils/frozen_dict.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
from copy import deepcopy
2-
from typing import Dict, TypeVar
2+
from typing import Dict, Generic, TypeVar
33

44
from .frozen_error import FrozenError
55

66
__all__ = ["FrozenDict"]
77

8-
K = TypeVar("K")
9-
T = TypeVar("T", covariant=True)
8+
KT = TypeVar("KT")
9+
VT = TypeVar("VT", covariant=True)
1010

1111

12-
class FrozenDict(Dict[K, T]):
12+
class FrozenDict(Dict[KT, VT]):
1313
"""Dictionary that can only be read, but not changed."""
1414

1515
def __delitem__(self, key):

src/graphql/pyutils/frozen_list.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
from copy import deepcopy
2-
from typing import List, TypeVar
2+
from typing import Generic, List, TypeVar
33

44
from .frozen_error import FrozenError
55

tox.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ commands =
2323
[testenv:docs]
2424
basepython = python3.8
2525
deps =
26-
sphinx>=3.2,<4
26+
sphinx>=3.4,<4
2727
sphinx_rtd_theme>=0.5,<1
2828
commands =
2929
sphinx-build -b html -nEW docs docs/_build/html

0 commit comments

Comments
 (0)