| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
pip install . ran with only pyproject.toml and uv.lock present, so
setuptools found no packages: the api package, the api.mcp templates
package-data and the console scripts never reached site-packages.
Because a console script resolves imports from its own bin directory
rather than the working directory, both entry points were broken in
the image:
cgraph BROKEN
cgraph-mcp BROKEN
which meant the documented CGRAPH_MODE=mcp path could not start at
all. Web mode only worked because uvicorn adds the working directory
to the import path.
Split the install: dependencies come from the exported uv.lock
requirements as before, keeping that layer cache-friendly, and the
project itself is installed with --no-deps after ./api and README.md
are copied.
Verified on the built image: cgraph and cgraph-mcp both run from
outside /app, the MCP server answers an initialize request, the
templates ship in site-packages, and web mode still resolves
STATIC_DIR to /app/app/dist and serves /api/list_repos with 200.
Addresses review feedback on #723.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
Warning Review limit reachedNext included review available in 16 minutes. View limit detailsLimit details: You’ve used all 2 included reviews currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 8a4f0f0e-a3ac-4655-8701-6d72c6d5c401 📥 CommitsReviewing files that changed from the base of the PR and between ecc1174 and 7d10b68. 📒 Files selected for processing (1)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. ❤️ ShareComment @coderabbitai help to get the list of available commands. |
Sorry, something went wrong.
There was a problem hiding this comment.
This PR fixes the Docker image build so the CodeGraph Python package (including api.mcp templates package-data and the cgraph/cgraph-mcp console scripts) is actually installed into site-packages by installing the project only after its sources are copied into the image.
Changes:
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Summary
Follow-up to #723, which merged before this last review point could be addressed.
pip install . runs immediately after COPY pyproject.toml uv.lock ./, i.e. with no project sources present. [tool.setuptools.packages.find] therefore matches nothing, so the api package, the api.mcp templates package-data and the console scripts never reach site-packages.
Because a console script resolves imports from its own bin directory rather than the working directory, both entry points are dead in the shipped image:
That makes the documented CGRAPH_MODE=mcp path in start.sh (exec cgraph-mcp) unable to start at all. Web mode only works by accident, because uvicorn adds the working directory to the import path.
Changes
Testing
Full build of the real Dockerfile, then inspected the resulting image:
OK: uv gone graphrag-sdk Version: 0.8.2 api installed: True cgraph OK <- run from / , not /app cgraph-mcp OK <- run from / , not /app templates dir: .../site-packages/api/mcp/templates exists: True ['claude_mcp_section.md', 'cursorrules.template'] STATIC_DIR: /app/app/dist exists: TrueRuntime smoke tests of both modes:
No regression to web mode: STATIC_DIR still resolves against /app/api, because the working directory takes precedence over site-packages on the import path.
Memory / Performance Impact
N/A — build configuration only, no runtime code changed. Image size is unaffected: the same wheels are installed, just in a different order.
Related Issues
Follow-up to #723 (review feedback that arrived after merge).