@@ -132,8 +132,9 @@ def _parse_skip_subdirs_file():
132132 'sphinxext.math_symbol_table' ,
133133 'sphinxext.missing_references' ,
134134 'sphinxext.mock_gui_toolkits' ,
135- 'sphinxext.skip_deprecated ' ,
135+ 'sphinxext.rcparams ' ,
136136 'sphinxext.redirect_from' ,
137+ 'sphinxext.skip_deprecated' ,
137138 'sphinx_copybutton' ,
138139 'sphinx_design' ,
139140 'sphinx_tags' ,
@@ -194,14 +195,16 @@ def _check_dependencies():
194195 gallery_order_sectionorder = 'sphinxext.gallery_order.sectionorder'
195196 gallery_order_subsectionorder = 'sphinxext.gallery_order.subsectionorder'
196197 clear_basic_units = 'sphinxext.util.clear_basic_units'
198+ patch_header = 'sphinxext.util.patch_header'
197199 matplotlib_reduced_latex_scraper = 'sphinxext.util.matplotlib_reduced_latex_scraper'
198200else :
199201 # gallery_order.py from the sphinxext folder provides the classes that
200202 # allow custom ordering of sections and subsections of the gallery
201203 from sphinxext .gallery_order import (
202204 sectionorder as gallery_order_sectionorder ,
203205 subsectionorder as gallery_order_subsectionorder )
204- from sphinxext .util import clear_basic_units , matplotlib_reduced_latex_scraper
206+ from sphinxext .util import (clear_basic_units , matplotlib_reduced_latex_scraper ,
207+ patch_header )
205208
206209if parse_version (sphinx_gallery .__version__ ) >= parse_version ('0.17.0' ):
207210 sg_matplotlib_animations = (True , 'mp4' )
@@ -305,7 +308,7 @@ def autodoc_process_bases(app, name, obj, options, bases):
305308 'reference_url' : {'matplotlib' : None , 'mpl_toolkits' : None },
306309 'prefer_full_module' : {r'mpl_toolkits\.' },
307310 'remove_config_comments' : True ,
308- 'reset_modules' : ('matplotlib' , clear_basic_units , 'sphinxext.util. patch_header' ),
311+ 'reset_modules' : ('matplotlib' , clear_basic_units , patch_header ),
309312 'subsection_order' : gallery_order_sectionorder ,
310313 'thumbnail_size' : (320 , 224 ),
311314 'within_subsection_order' : gallery_order_subsectionorder ,
@@ -899,3 +902,4 @@ def setup(app):
899902 if sphinx .version_info [:2 ] < (7 , 1 ):
900903 app .connect ('html-page-context' , add_html_cache_busting , priority = 1000 )
901904 generate_ScalarMappable_docs ()
905+ app .config .autodoc_use_legacy_class_based = True
0 commit comments