Skip to content

Commit 05681a1

Browse files
authored
Fix gallery pattern regex? (#3698)
Regex was generated by chatgpt, I haven't figured out lookaheads/behinds yet also briefly checked with hyperparameter tuning tutorial (didn't run the entire thing so idk about the rest of the tutorial generation but I did check that it probably didn't run anything else) shangdi reported the old pattern wasn't working, but this one seems to
1 parent 7f8b6dc commit 05681a1

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

conf.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,8 +263,9 @@ def wrapper(*args, **kwargs):
263263
# ignore_pattern also skips parsing.
264264
# See https://github.com/sphinx-gallery/sphinx-gallery/issues/721
265265
# for a more detailed description of the issue.
266+
# GALLERY_PATTERN should be a regular expression.
266267
sphinx_gallery_conf["ignore_pattern"] = (
267-
r"/(?!" + re.escape(os.getenv("GALLERY_PATTERN")) + r")[^/]+$"
268+
r"^(?!.*" + os.getenv("GALLERY_PATTERN") + r")"
268269
)
269270

270271
for i in range(len(sphinx_gallery_conf["examples_dirs"])):

0 commit comments

Comments
 (0)