Skip to content

Commit a1db1d2

Browse files
committed
regex escape separator - Win build was broken
1 parent 3bad2f2 commit a1db1d2

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

docs/sphinx/source/conf.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@
2020
# for generating GH links with linenumbers
2121
import 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
2528
import pandas as pd
@@ -383,6 +386,7 @@ def setup(app):
383386
# https://github.com/pvlib/pvlib-python/issues/837
384387
suppress_warnings = ['ref.footnote']
385388

389+
os_re_sep = re.escape(os.path.sep)
386390
# settings for sphinx-gallery
387391
sphinx_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',

0 commit comments

Comments
 (0)