30
30
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
31
31
# ones.
32
32
extensions = [
33
- ' sphinx.ext.autodoc' ,
33
+ " sphinx.ext.autodoc" ,
34
34
]
35
35
36
36
# Add any paths that contain templates here, relative to this directory.
37
- templates_path = [' _templates' ]
37
+ templates_path = [" _templates" ]
38
38
39
39
# The suffix(es) of source filenames.
40
40
# You can specify multiple suffix as a list of string:
41
41
#
42
42
# source_suffix = ['.rst', '.md']
43
- source_suffix = ' .rst'
43
+ source_suffix = " .rst"
44
44
45
45
# The encoding of source files.
46
46
#
47
47
# source_encoding = 'utf-8-sig'
48
48
49
49
# The master toctree document.
50
- master_doc = ' index'
50
+ master_doc = " index"
51
51
52
52
# General information about the project.
53
- project = ' GraphQL-core 3'
54
- copyright = ' 2022, Christoph Zwerschke'
55
- author = ' Christoph Zwerschke'
53
+ project = " GraphQL-core 3"
54
+ copyright = " 2022, Christoph Zwerschke"
55
+ author = " Christoph Zwerschke"
56
56
57
57
# The version info for the project you're documenting, acts as replacement for
58
58
# |version| and |release|, also used in various other places throughout the
61
61
# The short X.Y version.
62
62
# version = '3.2'
63
63
# The full version, including alpha/beta/rc tags.
64
- version = release = ' 3.2.3'
64
+ version = release = " 3.2.3"
65
65
66
66
# The language for content autogenerated by Sphinx. Refer to documentation
67
67
# for a list of supported languages.
68
68
#
69
69
# This is also used if you do content translation via gettext catalogs.
70
70
# Usually you set "language" from the command line for these cases.
71
- language = None
71
+ language = "en"
72
72
73
73
# There are two options for replacing |today|: either, you set today to some
74
74
# non-false value, then it is used:
82
82
# List of patterns, relative to source directory, that match files and
83
83
# directories to ignore when looking for source files.
84
84
# This patterns also effect to html_static_path and html_extra_path
85
- exclude_patterns = [' _build' , ' Thumbs.db' , ' .DS_Store' ]
85
+ exclude_patterns = [" _build" , " Thumbs.db" , " .DS_Store" ]
86
86
87
87
# AutoDoc configuration
88
88
autoclass_content = "class"
89
89
autodoc_default_options = {
90
- ' members' : True ,
91
- ' inherited-members' : True ,
92
- ' undoc-members' : True ,
93
- ' show-inheritance' : True
90
+ " members" : True ,
91
+ " inherited-members" : True ,
92
+ " undoc-members" : True ,
93
+ " show-inheritance" : True ,
94
94
}
95
95
autosummary_generate = True
96
96
97
97
autodoc_type_aliases = {
98
- ' AwaitableOrValue' : ' graphql.pyutils.AwaitableOrValue' ,
99
- ' FormattedSourceLocation' : ' graphql.language.FormattedSourceLocation' ,
100
- ' Middleware' : ' graphql.execution.Middleware' ,
101
- ' TypeMap' : ' graphql.schema.TypeMap'
98
+ " AwaitableOrValue" : " graphql.pyutils.AwaitableOrValue" ,
99
+ " FormattedSourceLocation" : " graphql.language.FormattedSourceLocation" ,
100
+ " Middleware" : " graphql.execution.Middleware" ,
101
+ " TypeMap" : " graphql.schema.TypeMap" ,
102
102
}
103
103
104
104
# GraphQL-core top level modules with submodules that can be omitted.
105
105
# Sometimes autodoc cannot find classes since it is looking for the
106
106
# qualified form, but the documentation has the shorter form.
107
107
# We need to give autodoc a little help in this cases.
108
108
graphql_modules = {
109
- 'error' : ['graphql_error' ],
110
- 'execution' : ['execute' , 'middleware' ],
111
- 'language' : ['ast' , 'directive_locations' , 'location' ,
112
- 'source' , 'token_kind' , 'visitor' ],
113
- 'pyutils' : ['simple_pub_sub' , 'frozen_list' , 'path' ],
114
- 'type' : ['definition' , 'directives' , 'schema' ],
115
- 'utilities' : ['find_breaking_changes' , 'type_info' ],
116
- 'validation' : ['rules' , 'validation_context' ]}
109
+ "error" : ["graphql_error" ],
110
+ "execution" : ["execute" , "middleware" ],
111
+ "language" : [
112
+ "ast" ,
113
+ "directive_locations" ,
114
+ "location" ,
115
+ "source" ,
116
+ "token_kind" ,
117
+ "visitor" ,
118
+ ],
119
+ "pyutils" : ["simple_pub_sub" , "frozen_list" , "path" ],
120
+ "type" : ["definition" , "directives" , "schema" ],
121
+ "utilities" : ["find_breaking_changes" , "type_info" ],
122
+ "validation" : ["rules" , "validation_context" ],
123
+ }
117
124
118
125
# GraphQL-core classes that autodoc sometimes cannot find
119
126
# (e.g. where specified as string in type hints).
120
127
# We need to give autodoc a little help in this cases, too:
121
128
graphql_classes = {
122
- ' GraphQLAbstractType' : ' type' ,
123
- ' GraphQLObjectType' : ' type' ,
124
- ' GraphQLOutputType' : ' type' ,
125
- ' GraphQLTypeResolver' : ' type' ,
126
- ' Node' : ' language' ,
127
- ' Source' : ' language' ,
128
- ' SourceLocation' : ' language'
129
+ " GraphQLAbstractType" : " type" ,
130
+ " GraphQLObjectType" : " type" ,
131
+ " GraphQLOutputType" : " type" ,
132
+ " GraphQLTypeResolver" : " type" ,
133
+ " Node" : " language" ,
134
+ " Source" : " language" ,
135
+ " SourceLocation" : " language" ,
129
136
}
130
137
131
138
# ignore the following undocumented or internal references:
132
- ignore_references = set ('''
139
+ ignore_references = set (
140
+ """
133
141
GNT GT KT T VT
134
142
enum.Enum
135
143
traceback
146
154
graphql.validation.validation_context.VariableUsage
147
155
graphql.validation.rules.known_argument_names.KnownArgumentNamesOnDirectivesRule
148
156
graphql.validation.rules.provided_required_arguments.ProvidedRequiredArgumentsOnDirectivesRule
149
- ''' .split ())
157
+ """ .split ()
158
+ )
150
159
151
160
ignore_references .update (__builtins__ .keys ())
152
161
153
162
154
163
def on_missing_reference (app , env , node , contnode ):
155
164
"""Fix or skip any missing references."""
156
- if node .get (' refdomain' ) != 'py' :
165
+ if node .get (" refdomain" ) != "py" :
157
166
return None
158
- target = node .get (' reftarget' )
167
+ target = node .get (" reftarget" )
159
168
if not target :
160
169
return None
161
- if target in ignore_references or target .endswith (' Kwargs' ):
170
+ if target in ignore_references or target .endswith (" Kwargs" ):
162
171
return contnode
163
- typ = node .get (' reftype' )
164
- name = target .rsplit ('.' , 1 )[- 1 ]
165
- if name in ('GT' , ' GNT' , 'KT' , 'T' , 'VT' ):
172
+ typ = node .get (" reftype" )
173
+ name = target .rsplit ("." , 1 )[- 1 ]
174
+ if name in ("GT" , " GNT" , "KT" , "T" , "VT" ):
166
175
return contnode
167
- if typ == ' obj' :
168
- if target .startswith (' typing.' ):
169
- if name in (' Any' , ' Optional' , ' Union' ):
176
+ if typ == " obj" :
177
+ if target .startswith (" typing." ):
178
+ if name in (" Any" , " Optional" , " Union" ):
170
179
return contnode
171
- if typ != ' class' :
180
+ if typ != " class" :
172
181
return None
173
- if '.' in target : # maybe too specific
174
- base_module , target = target .split ('.' , 1 )
175
- if base_module == ' graphql' :
176
- if '.' not in target :
182
+ if "." in target : # maybe too specific
183
+ base_module , target = target .split ("." , 1 )
184
+ if base_module == " graphql" :
185
+ if "." not in target :
177
186
return None
178
- base_module , target = target .split ('.' , 1 )
179
- if '.' not in target :
187
+ base_module , target = target .split ("." , 1 )
188
+ if "." not in target :
180
189
return None
181
190
sub_modules = graphql_modules .get (base_module )
182
191
if not sub_modules :
183
192
return
184
- sub_module = target .split ('.' , 1 )[0 ]
193
+ sub_module = target .split ("." , 1 )[0 ]
185
194
if sub_module not in sub_modules :
186
195
return None
187
- target = ' graphql.' + base_module + '.' + target .rsplit ('.' , 1 )[- 1 ]
196
+ target = " graphql." + base_module + "." + target .rsplit ("." , 1 )[- 1 ]
188
197
else : # maybe not specific enough
189
198
base_module = graphql_classes .get (target )
190
199
if not base_module :
191
200
return None
192
- target = ' graphql.' + base_module + '.' + target
201
+ target = " graphql." + base_module + "." + target
193
202
# replace target
194
- if contnode .__class__ .__name__ == ' Text' :
203
+ if contnode .__class__ .__name__ == " Text" :
195
204
contnode = contnode .__class__ (target )
196
- elif contnode .__class__ .__name__ == ' literal' :
205
+ elif contnode .__class__ .__name__ == " literal" :
197
206
if len (contnode .children ) != 1 :
198
207
return None
199
208
textnode = contnode .children [0 ]
200
209
contnode .children [0 ] = textnode .__class__ (target )
201
210
else :
202
211
return None
203
- node [' reftarget' ] = target
204
- fromdoc = node .get (' refdoc' )
212
+ node [" reftarget" ] = target
213
+ fromdoc = node .get (" refdoc" )
205
214
if not fromdoc :
206
- doc_module = node .get (' py:module' )
215
+ doc_module = node .get (" py:module" )
207
216
if doc_module :
208
- if doc_module .startswith (' graphql.' ):
209
- doc_module = doc_module .split ('.' , 1 )[- 1 ]
210
- if doc_module not in graphql_modules and doc_module != ' graphql' :
217
+ if doc_module .startswith (" graphql." ):
218
+ doc_module = doc_module .split ("." , 1 )[- 1 ]
219
+ if doc_module not in graphql_modules and doc_module != " graphql" :
211
220
doc_module = None
212
- fromdoc = ' modules/' + (doc_module or base_module )
221
+ fromdoc = " modules/" + (doc_module or base_module )
213
222
# try resolving again with replaced target
214
- return env .domains ['py' ].resolve_xref (
215
- env , fromdoc , app .builder , typ , target , node , contnode )
223
+ return env .domains ["py" ].resolve_xref (
224
+ env , fromdoc , app .builder , typ , target , node , contnode
225
+ )
216
226
217
227
218
228
def on_skip_member (_app , what , name , _obj , skip , _options ):
219
- if what == ' class' and name == "__init__" :
229
+ if what == " class" and name == "__init__" :
220
230
# we could set "special-members" to "__init__",
221
231
# but this gives an error when documenting modules
222
232
return False
223
233
return skip
224
234
225
235
226
236
def setup (app ):
227
- app .connect (' missing-reference' , on_missing_reference )
237
+ app .connect (" missing-reference" , on_missing_reference )
228
238
app .connect ("autodoc-skip-member" , on_skip_member )
229
239
230
240
@@ -252,7 +262,7 @@ def setup(app):
252
262
# show_authors = False
253
263
254
264
# The name of the Pygments (syntax highlighting) style to use.
255
- pygments_style = ' sphinx'
265
+ pygments_style = " sphinx"
256
266
257
267
# A list of ignored prefixes for module index sorting.
258
268
# modindex_common_prefix = []
@@ -268,15 +278,13 @@ def setup(app):
268
278
# The theme to use for HTML and HTML Help pages. See the documentation for
269
279
# a list of builtin themes.
270
280
#
271
- html_theme = ' sphinx_rtd_theme'
281
+ html_theme = " sphinx_rtd_theme"
272
282
273
283
# Theme options are theme-specific and customize the look and feel of a theme
274
284
# further. For a list of options available for each theme, see the
275
285
# documentation.
276
286
#
277
- html_theme_options = {
278
- 'navigation_depth' : 5
279
- }
287
+ html_theme_options = {"navigation_depth" : 5 }
280
288
281
289
# Add any paths that contain custom themes here, relative to this directory.
282
290
# html_theme_path = []
@@ -384,34 +392,36 @@ def setup(app):
384
392
# html_search_scorer = 'scorer.js'
385
393
386
394
# Output file base name for HTML help builder.
387
- htmlhelp_basename = ' GraphQL-core-3-doc'
395
+ htmlhelp_basename = " GraphQL-core-3-doc"
388
396
389
397
# -- Options for LaTeX output ---------------------------------------------
390
398
391
399
latex_elements = {
392
- # The paper size ('letterpaper' or 'a4paper').
393
- #
394
- # 'papersize': 'letterpaper',
395
-
396
- # The font size ('10pt', '11pt' or '12pt').
397
- #
398
- # 'pointsize': '10pt',
399
-
400
- # Additional stuff for the LaTeX preamble.
401
- #
402
- # 'preamble': '',
403
-
404
- # Latex figure (float) alignment
405
- #
406
- # 'figure_align': 'htbp',
400
+ # The paper size ('letterpaper' or 'a4paper').
401
+ #
402
+ # 'papersize': 'letterpaper',
403
+ # The font size ('10pt', '11pt' or '12pt').
404
+ #
405
+ # 'pointsize': '10pt',
406
+ # Additional stuff for the LaTeX preamble.
407
+ #
408
+ # 'preamble': '',
409
+ # Latex figure (float) alignment
410
+ #
411
+ # 'figure_align': 'htbp',
407
412
}
408
413
409
414
# Grouping the document tree into LaTeX files. List of tuples
410
415
# (source start file, target name, title,
411
416
# author, documentclass [howto, manual, or own class]).
412
417
latex_documents = [
413
- (master_doc , 'GraphQL-core-3.tex' , 'GraphQL-core 3 Documentation' ,
414
- 'Christoph Zwerschke' , 'manual' ),
418
+ (
419
+ master_doc ,
420
+ "GraphQL-core-3.tex" ,
421
+ "GraphQL-core 3 Documentation" ,
422
+ "Christoph Zwerschke" ,
423
+ "manual" ,
424
+ ),
415
425
]
416
426
417
427
# The name of an image file (relative to this directory) to place at the top of
@@ -445,10 +455,7 @@ def setup(app):
445
455
446
456
# One entry per manual page. List of tuples
447
457
# (source start file, name, description, authors, manual section).
448
- man_pages = [
449
- (master_doc , 'graphql-core' , 'GraphQL-core 3 Documentation' ,
450
- [author ], 1 )
451
- ]
458
+ man_pages = [(master_doc , "graphql-core" , "GraphQL-core 3 Documentation" , [author ], 1 )]
452
459
453
460
# If true, show URL addresses after external links.
454
461
#
@@ -461,9 +468,15 @@ def setup(app):
461
468
# (source start file, target name, title, author,
462
469
# dir menu entry, description, category)
463
470
texinfo_documents = [
464
- (master_doc , 'GraphQL-core' , 'GraphQL-core 3 Documentation' ,
465
- author , 'GraphQL-core 3' , 'One line description of project.' ,
466
- 'Miscellaneous' ),
471
+ (
472
+ master_doc ,
473
+ "GraphQL-core" ,
474
+ "GraphQL-core 3 Documentation" ,
475
+ author ,
476
+ "GraphQL-core 3" ,
477
+ "One line description of project." ,
478
+ "Miscellaneous" ,
479
+ ),
467
480
]
468
481
469
482
# Documents to append as an appendix to all manuals.
0 commit comments