-
Notifications
You must be signed in to change notification settings - Fork 0
Fix/sphinx build discovery #3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -180,18 +180,26 @@ def find_sphinx_build(workspace: Path) -> str: | |||||||||||||||
| """Locate the sphinx-build executable. | ||||||||||||||||
|
|
||||||||||||||||
| Search order: | ||||||||||||||||
| 1. ``workspace/.venv/bin/sphinx-build`` | ||||||||||||||||
| 2. Walk parent directories for ``.venv/bin/sphinx-build`` | ||||||||||||||||
| 3. ``shutil.which("sphinx-build")`` (system PATH) | ||||||||||||||||
| 1. Same directory as the running Python interpreter (covers pipx / venv installs) | ||||||||||||||||
| 2. ``workspace/.venv/bin/sphinx-build`` | ||||||||||||||||
| 3. Walk parent directories for ``.venv/bin/sphinx-build`` | ||||||||||||||||
| 4. ``shutil.which("sphinx-build")`` (system PATH) | ||||||||||||||||
|
|
||||||||||||||||
| Returns the path string, or raises ``FileNotFoundError``. | ||||||||||||||||
| """ | ||||||||||||||||
| # 1. Workspace venv | ||||||||||||||||
| # 1. Running Python's own environment (pipx, venv, conda, etc.) | ||||||||||||||||
| # Use parent of sys.executable WITHOUT resolving symlinks, so that | ||||||||||||||||
| # pipx/venv wrapper scripts point to the correct bin directory. | ||||||||||||||||
| own_bin = Path(sys.executable).parent / "sphinx-build" | ||||||||||||||||
| if own_bin.exists(): | ||||||||||||||||
| return str(own_bin) | ||||||||||||||||
|
Comment on lines
+193
to
+195
|
||||||||||||||||
| own_bin = Path(sys.executable).parent / "sphinx-build" | |
| if own_bin.exists(): | |
| return str(own_bin) | |
| own_bin_dir = Path(sys.executable).parent | |
| own_bin = shutil.which("sphinx-build", path=str(own_bin_dir)) | |
| if own_bin: | |
| return own_bin |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The README suggests
--type mem,fact, but the CLI’s--typefilter is a single string comparison (need.get("type") != type_filter), so comma-separated values won’t work and will return no matches. Either update the docs to use a single type (or multiple commands), or extend the CLI to accept a comma-separated list / repeated--typeflags.