Skip to content

Commit b7f3397

Browse files
committed
fix more doc build issues
1 parent 8e39338 commit b7f3397

File tree

2 files changed

+19
-7
lines changed

2 files changed

+19
-7
lines changed

docs/source/_exts/autogen_api_docs.py

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
from __future__ import annotations
2+
3+
import sys
14
from pathlib import Path
25

36
from sphinx.application import Sphinx
@@ -29,12 +32,9 @@ def generate_api_docs():
2932
"private.misc": [PRIVATE_MISC_TITLE],
3033
}
3134

32-
for file in sorted(PACKAGE_SRC.glob("**/*.py")):
33-
if "node_modules" in file.parts:
34-
# don't look in javascript source
35-
continue
36-
if file.stem.startswith("__"):
37-
# skip __init__ and __main__
35+
for file in sorted(pathlib_walk(PACKAGE_SRC, ignore_dirs=["node_modules"])):
36+
if not file.suffix == ".py" or file.stem.startswith("__"):
37+
# skip non-Python files along with __init__ and __main__
3838
continue
3939
public_vs_private = "private" if is_private_module(file) else "public"
4040
main_vs_misc = "main" if file_starts_with_docstring(file) else "misc"
@@ -53,6 +53,16 @@ def generate_api_docs():
5353
PRIVATE_API_REFERENCE_FILE.write_text("\n".join(private_content))
5454

5555

56+
def pathlib_walk(root: Path, ignore_dirs: list[str]):
57+
for path in root.iterdir():
58+
if path.is_dir():
59+
if path.name in ignore_dirs:
60+
continue
61+
yield from pathlib_walk(path, ignore_dirs)
62+
else:
63+
yield path
64+
65+
5666
def is_private_module(path: Path) -> bool:
5767
return any(p.startswith("_") for p in path.parts)
5868

@@ -75,5 +85,7 @@ def file_starts_with_docstring(path: Path) -> bool:
7585

7686

7787
def setup(app: Sphinx) -> None:
88+
if sys.platform == "win32" and sys.version_info[:2] == (3, 7):
89+
return None
7890
generate_api_docs()
7991
return None

docs/source/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@
105105

106106
# Used to stop the extension from loading bootstrap twice since the `pydata_sphinx_theme`
107107
# already adds it for use.
108-
panels_add_boostrap_css = False
108+
panels_add_bootstrap_css = False
109109

110110
# -- sphinx.ext.autodoc --
111111

0 commit comments

Comments
 (0)