Repository navigation
fix(modules): mark an editable install in the distribution reader - #59
Conversation
The run builds the call graph of each file in the workers, for the index. A cached plugin that reads the call graph, as the file plugin of vet, built it again in Analyze. The extra plugins run on the goroutine of the run, so that second build is serial work. On gitea it took 8.9 s of the 21 s that the plugin of vet spent on that goroutine, and the goroutine set the wall time of the run. The worker now keeps the call graph of the index in its outcome. A plugin that implements the new GraphPlugin gets it through AnalyzeGraph. A file with no call graph, as one whose index failed, still goes to Analyze. The index is complete before the plugin runs, so the plugin cannot change the index. The callgraph plugin gets AnalyzeGraph too, so a caller with a graph runs its callback and its partial check without a second build. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PFQbqPqd9xn1fT6hBsyoUm Signed-off-by: Claude <noreply@anthropic.com>
A review found three gaps in the shared call graph. Each outcome kept its call graph, also in a run with no GraphPlugin. The pool keeps two outcomes per worker in flight, so a run with no plugin held graphs that it never read. The pool now keeps a graph only when the run has a GraphPlugin. The GraphPlugin doc said that a file whose index failed goes to Analyze. A file that the deadline cut has a failed index and a partial graph, and it goes to AnalyzeGraph. The doc now says that a file whose call graph did not build goes to Analyze. It also says that a file that the workers finished before the deadline gets its full graph. The run test checked only the file name of the graph. It now compares the graph with the one that callgraph.Build gives for the tree. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PFQbqPqd9xn1fT6hBsyoUm Signed-off-by: Claude <noreply@anthropic.com>
The call graph build wrote a debug line for each call, each definition and each resolved call or constructor. A debug index run of gitea wrote 185,860 lines, and 160,836 of them were "Go call". The log took 2.3 s of a 15.8 s run. The lines named what the graph holds, so they did not help to find a fault. dry/log has no trace level, so the build no longer writes them. It keeps the line for each file and the lines that report a problem, as a node with no name or a limit that the build hit. The debug run of gitea writes 5,566 lines and takes 13.8 s. A new test builds a file with one call and with 50 calls in Go, JavaScript, Python and Java, and expects the same number of log lines. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PFQbqPqd9xn1fT6hBsyoUm Signed-off-by: Claude <noreply@anthropic.com>
…ython-call-graph-plan-vakrcz
An editable install has a .dist-info in site-packages, and its RECORD lists a .pth file and no Python file. The distribution graph walked it, found no file and opened it, so a project that pip install -e . installs reached an open node on each scan. The code of an editable install is the project itself. The distribution reader now reads direct_url.json and marks an editable install. The distribution graph leaves it out. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0149TuYSppnJAa4JVsXXqHDA
SafeDep Report SummaryNo dependency changes detected. Nothing to scan. This report is generated by SafeDep GitHub App |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Caution Review failedThe pull request is closed.
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. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7229801d16
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if !d.Editable { | ||
| b.addDistribution(sp, d) |
There was a problem hiding this comment.
Retain editable dependencies outside the scanned project
When the environment contains an editable dependency installed from another directory (for example, a sibling library), Editable does not mean its source is inside ProjectFS. Dropping that distribution also removes its import names from byTop, while the project walk never reads its code. If the project imports that library inside a try guarded by ImportError, resolve now ignores the import entirely instead of reaching the library's open node, so the library's transitive dependencies can incorrectly appear unreachable. Only omit an editable distribution after establishing that the project walk covers its source; otherwise retain it as an open node.
Useful? React with 👍 / 👎.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #59 +/- ##
=======================================
Coverage 77.17% 77.18%
=======================================
Files 180 180
Lines 18148 18163 +15
=======================================
+ Hits 14006 14019 +13
- Misses 3299 3300 +1
- Partials 843 844 +1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
v2 pinned a commit on a branch of safedep/code, because the import graph of a Python manifest needed the editable-install flag of the distribution reader before safedep/code#59 merged. main holds it now. Claude-Session: https://claude.ai/code/session_0149TuYSppnJAa4JVsXXqHDA Co-authored-by: Claude <noreply@anthropic.com>



Summary
An editable install, as
pip install -e .oruv syncmakes for the project, has a.dist-infoin site-packages whoseRECORDlists a.pthfile and no Python file. The distribution graph walked it, found no file and opened it, so a project that installs itself in editable mode reached an open node on each scan. The code of an editable install is the project itself, not a copy under site-packages.modules.DistributiongetsEditable, whichreadDistributionsets from thedir_info.editablefield ofdirect_url.json, the file that PEP 610 writes for an install from a directory or a URL. A.dist-infowith no such file is a regular install, and one with an install from a git URL is not editable.distgraph.Buildleaves an editable install out of the nodes. The walk of the project reads its code.docs/distgraph.mdsays so.safedep/vet#854, merged, pins this branch and reads
Editableto skip such a distribution as a unit of dependency code. Once this merges, vet re-pinsmain.The branch carries two merge commits from the time it tracked #58 before #58 merged. The change against
mainis the five files of the editable install.Tests
TestPythonDistributionscovers an editable install and an install from a git URL.TestBuildLeavesOutAnEditableInstallchecks that the graph has no node for the editable install and that its imports come from the project.go test ./...of the touched packages andgolangci-lintpass.Generated by Claude Code