GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||||||||||||||
GeezerVison is showing github.com — Fix Poetry venv discovery to match Poetry (#327, #329) by mikolalysenko · Pull Request #330 · SocketDev/socket-patch Conversation
|
| Issue | Case | Regression test | Red on main |
Green |
|---|---|---|---|---|
| #327 | 1. nameless package-mode = false |
poetry_project_names_follow_poetry_core_precedence, poetry_out_of_tree_virtualenvs_are_discovered_without_a_dot_venv (nameless step) |
✅ fails | ✅ |
| #327 | 2. [project].name + [tool.poetry].name |
same two tests (pep-name step) |
✅ fails | ✅ |
| #327 | 3. in-project = false + stray .venv |
poetry_out_of_tree_virtualenvs_are_discovered_without_a_dot_venv (in-project step) |
✅ fails (returned proj/.venv/...) |
✅ |
| #329 | Windows \\?\ hash |
windows_normcase_drops_the_verbatim_prefix_like_python_realpath; #[cfg(windows)] poetry_normalized_cwd_has_no_verbatim_prefix_on_windows |
✅ fails | ✅ (incl. CI test (windows-latest)) |
poetry env use. find_local_venv_site_packages returned exactly the env poetry env info -p reports for the nameless, both-names and in-project = false projects.🤖 Generated with Claude Code
https://claude.ai/code/session_017mSDqYENPT34fbMjLSQzBg
Note
Medium Risk
Changes which Python site-packages agent mode targets for patching; mis-discovery would skip or mis-apply patches, though the change is read-only discovery with extensive regression tests.
Overview
Agent mode (scan --mode agent) now locates Poetry’s real out-of-tree virtualenv in setups where discovery used to pick the wrong interpreter, skip patches as package_not_installed, and still exit 0.
In python_crawler.rs, venv probe order mirrors Poetry’s EnvManager.use_in_project_venv: when Poetry would not use ./.venv (explicit virtualenvs.in-project = false, or no in-project dir), Poetry’s cache env is checked before local ./.venv / ./venv, so stray local dirs from other tools no longer shadow Poetry’s install.
Env naming follows poetry-core: [project] name (2.x), then [tool.poetry] name, then non-package-mode; the first candidate with a matching <name>-<hash>-py* directory wins (Poetry 1.8 still finds legacy-named envs).
On Windows, cwd hashing strips the \\?\ verbatim prefix from canonicalize, matching Python’s realpath/normcase (shared helper with Pipenv path normalization).
CHANGELOG and docs/testing/poetry-compatibility.md document the behavior; unit/integration tests cover the #327/#329 cases.
Reviewed by Cursor Bugbot for commit 50cde0a. Configure here.
Generated by Claude Code
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Assisted-by: Claude Code:claude-opus-5-5
Agent mode missed the virtualenv Poetry installed into for nameless package-mode = false projects, Poetry 2 projects naming both [project] and [tool.poetry], projects with in-project = false next to a stray .venv, and every project on Windows. The scan then skipped the patch and exited 0. Pick the env name in poetry-core's order ([project].name, then [tool.poetry].name, then non-package-mode), honour an explicit in-project setting before ./.venv, and drop the \\?\ prefix before hashing the cwd on Windows. Fixes #327 Fixes #329 Assisted-by: Claude Code:claude-opus-5-5
|
BugBot review Generated by Claude Code |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Stale Bugbot comment from a previous run.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Resolve conflicts with #277: keep Poetry-aware venv probe order in find_local_venv_site_packages and add the Poetry entry to the consolidated changelog. Assisted-by: Claude Code:claude-opus-5-5
|
BugBot review Generated by Claude Code |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Stale Bugbot comment from a previous run.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
[burn-down agent] Ready for review on Generated by Claude Code |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Union the CHANGELOG Fixed entries from both sides. Co-Authored-By: Claude <[email protected]>
There was an error while loading. Please reload this page.
|
bugbot run Generated by Claude Code |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Keeps both CHANGELOG entries (gem manifest fix and the Poetry venv fix from #330). Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01L6i4cQ51yarBFnFs2b8HRx
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 50cde0a. Configure here.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
#330 reordered Poetry venv discovery in the same function. Keep both: a Pipenv project uses only the venv Pipenv resolves, then Poetry's out-of-tree env when Poetry would not use ./.venv, then the generic .venv / venv probes. Assisted-by: Claude Code:claude-opus-5-5
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_015S6JgBt7UbFe5cCPM9xbYp
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
Windows agent-mode scan never finds Poetry's default out-of-tree virtualenv, so patches are skipped and the scan exits 0 Agent-mode scan misses Poetry's venv for nameless non-package-mode projects, [project].name overrides, and in-project = false with a stray .venv, and still exits 0
There was an error while loading. Please reload this page.