fix: include docs/ in wheel and look up bundled copy at runtime#485
Open
mvanhorn wants to merge 1 commit into
Open
fix: include docs/ in wheel and look up bundled copy at runtime#485mvanhorn wants to merge 1 commit into
mvanhorn wants to merge 1 commit into
Conversation
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.
Summary
get_docs_section(used bydocsandsuggested_questionsMCP tools) only searched filesystem-relative paths. Afterpipx install code-review-graph==2.3.2, the wheel didn't includedocs/LLM-OPTIMIZED-REFERENCE.md, so both tools returnedstatus: error, reason: docs_not_foundoutside a checked-out repo.Two changes:
pyproject.toml:tool.hatch.build.targets.wheel.force-includeshipsdocs/LLM-OPTIMIZED-REFERENCE.mdtocode_review_graph/docs/LLM-OPTIMIZED-REFERENCE.mdinside the wheel.tools/docs.py: when norepo_rootis passed, check the in-packagecode_review_graph/docs/first; fall back to source-treedocs/next to the package. Both paths now resolve.This PR is scoped to bug 1 of #480; bug 2 (
suggested_questionsreturning role-userdicts) is already addressed in 4b6293f.Why this matters
#480 surfaces a hard failure for pipx/uvx users on 2.3.2. The wheel layout is the root cause —
tool.hatch.build.targets.wheel.packages = ["code_review_graph"]doesn't pick up top-leveldocs/. Force-include inpyproject.tomlships the file in the wheel at a path the runtime can find. 2 new tests assert both the source-tree path and the bundled-wheel path resolve from outside any repo.closes #480
AI was used for assistance.