Skip API reference generation for non-Python projects - #264
Merged
has2k1 merged 1 commit intoJul 17, 2026
Conversation
_add_api_reference_config() ran for every project regardless of type. For a Go-only project (project_type: go) there is no root pyproject.toml or top-level Python package, so _detect_package_name() returned None and the build dropped into an interactive input() prompt asking the user to type a package name — blocking non-interactive and uvx-driven builds. Gate the step on the existing Config.is_python_project so non-Python projects skip it cleanly (mirroring how the PyPI link already defaults off for non-Python projects). This needs no new config key: project_type already carries the necessary information. The separate Go CLI reference path is unaffected. Add a regression test that patches builtins.input to fail loudly if the prompt is ever reached for a Go project.
Collaborator
|
LGTM |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Running
great-docs buildin a Go-only project (project_type: go) blocks on an interactive prompt:_add_api_reference_config()ran for every project regardless of type. For a Go project there is no rootpyproject.tomlor top-level Python package, so_detect_package_name()returnsNoneand the build drops into aninput()prompt — which hangs non-interactive anduvx-driven builds.Fix
Gate the API-reference step on the existing
Config.is_python_project, so non-Python projects skip it cleanly. This mirrors how the PyPI link already defaults off for non-Python projects, and needs no new config key —project_typealready carries the necessary information. The separate Go CLI reference path is unaffected.Testing
test_add_api_reference_config_non_python_project, which patchesbuiltins.inputto fail loudly if the prompt is ever reached for a Go project.add_api_reference_configtests pass.great-docs buildon a Go project (velocirepo) now completes without prompting, printsAPI reference skipped (non-Python project), and still generates the Go CLI reference.The 23 pre-existing failures in
tests/test_synthetic.pyare unrelated to this change (confirmed by reproducing them onmain).