1616from sphinx .util .typing import restify , stringify_annotation
1717
1818if TYPE_CHECKING :
19- from collections .abc import Iterator
19+ from collections .abc import Iterator , Mapping , MutableSet
2020 from typing import Literal
2121
2222 from sphinx .config import Config
23- from sphinx .environment import BuildEnvironment , _CurrentDocument
23+ from sphinx .environment import _CurrentDocument
2424 from sphinx .events import EventManager
2525 from sphinx .ext .autodoc ._directive_options import _AutoDocumenterOptions
2626 from sphinx .ext .autodoc ._property_types import _ItemProperties
@@ -38,13 +38,14 @@ def _generate_directives(
3838 * ,
3939 config : Config ,
4040 current_document : _CurrentDocument ,
41- env : BuildEnvironment ,
4241 events : EventManager ,
4342 get_attr : _AttrGetter ,
4443 indent : str ,
4544 options : _AutoDocumenterOptions ,
4645 props : _ItemProperties ,
4746 record_dependencies : set [str ],
47+ ref_context : Mapping [str , str | None ],
48+ reread_always : MutableSet [str ],
4849 result : StringList ,
4950) -> None :
5051 """Generate reST for the object given by *props*, and possibly for its members.
@@ -136,14 +137,15 @@ def _generate_directives(
136137 attr_docs = analyzer .attr_docs if analyzer is not None else {},
137138 config = config ,
138139 current_document = current_document ,
139- env = env ,
140140 events = events ,
141141 get_attr = get_attr ,
142142 indent = indent ,
143143 options = options ,
144144 props = props ,
145145 real_modname = real_modname ,
146146 record_dependencies = record_dependencies ,
147+ ref_context = ref_context ,
148+ reread_always = reread_always ,
147149 result = result ,
148150 )
149151
@@ -204,14 +206,15 @@ def _document_members(
204206 attr_docs : dict [tuple [str , str ], list [str ]],
205207 config : Config ,
206208 current_document : _CurrentDocument ,
207- env : BuildEnvironment ,
208209 events : EventManager ,
209210 get_attr : _AttrGetter ,
210211 indent : str ,
211212 options : _AutoDocumenterOptions ,
212213 props : _ItemProperties ,
213214 real_modname : str ,
214215 record_dependencies : set [str ],
216+ ref_context : Mapping [str , str | None ],
217+ reread_always : MutableSet [str ],
215218 result : StringList ,
216219) -> None :
217220 """Generate reST for member documentation.
@@ -233,12 +236,13 @@ def _document_members(
233236 attr_docs = attr_docs ,
234237 config = config ,
235238 current_document = current_document ,
236- env = env ,
237239 events = events ,
238240 get_attr = get_attr ,
239241 options = options ,
240242 parent_modname = real_modname ,
241243 props = props ,
244+ ref_context = ref_context ,
245+ reread_always = reread_always ,
242246 )
243247
244248 # for implicit module members, check __module__ to avoid
@@ -259,13 +263,14 @@ def _document_members(
259263 all_members = True ,
260264 config = config ,
261265 current_document = current_document ,
262- env = env ,
263266 events = events ,
264267 get_attr = get_attr ,
265268 indent = member_indent ,
266269 options = options ,
267270 props = member_props ,
268271 record_dependencies = record_dependencies ,
272+ ref_context = ref_context ,
273+ reread_always = reread_always ,
269274 result = result ,
270275 )
271276
0 commit comments