File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2020# for generating GH links with linenumbers
2121import inspect
2222
23+ # to escape special characters in sphinx-gallery OS-dependant regex
24+ import re
25+
2326# import distutils before calling pd.show_versions()
2427# https://github.com/pypa/setuptools/issues/3044
2528import pandas as pd
@@ -383,6 +386,7 @@ def setup(app):
383386# https://github.com/pvlib/pvlib-python/issues/837
384387suppress_warnings = ['ref.footnote' ]
385388
389+ os_re_sep = re .escape (os .path .sep )
386390# settings for sphinx-gallery
387391sphinx_gallery_conf = {
388392 'examples_dirs' : ['../../examples' ], # location of gallery scripts
@@ -392,7 +396,7 @@ def setup(app):
392396 # first group + sep := match folders up to filename
393397 # negative lookahead + match anything but sep := match filename (if valid)
394398 # https://sphinx-gallery.github.io/stable/configuration.html#parsing-and-executing-examples-via-matching-patterns # noqa: E501
395- 'filename_pattern' : rf"^(.*){ os . path . sep } (?!NX_)([^{ os . path . sep } ]*)$" ,
399+ 'filename_pattern' : rf"^(.*){ os_re_sep } (?!NX_)([^{ os_re_sep } ]*)$" ,
396400
397401 # directory where function/class granular galleries are stored
398402 'backreferences_dir' : 'reference/generated/gallery_backreferences' ,
You can’t perform that action at this time.
0 commit comments