Skip to content

Fix uv env skipped beside a Poetry plugin (#1916) - #1922

Open
Mikola Lysenko (mikolalysenko) wants to merge 3 commits into
mainfrom
agent/fix-uv-poetry-plugin-table
Open

Mikola Lysenko (mikolalysenko) wants to merge 3 commits into
mainfrom
agent/fix-uv-poetry-plugin-table

Conversation

@mikolalysenko

@mikolalysenko Mikola Lysenko (mikolalysenko) commented Nov 1, 2026 •

Copy link
Copy Markdown
Collaborator

LLM Description written by Claude Code:claude-opus-5-5

Fixes #1916

Summary

A lockless uv project (no uv.lock) whose pyproject.toml carries a
Poetry plugin table, such as [tool.poetry-dynamic-versioning] (often
used with non-Poetry backends), was treated as a Poetry project. Its
UV_PROJECT_ENVIRONMENT was then never crawled, so scan, apply and VEX
missed every package installed there. A comment line # [tool.poetry]
did the same.

Root cause

Three rules decide whether a pyproject.toml declares [tool.poetry].
python_crawler::declares_tool_poetry parses the TOML and ignores plugin
tables, but claimed_by_non_uv_manager (the gate for the lockless-uv
UV_PROJECT_ENVIRONMENT branch and for uv_owns_project_env) used
text.contains("[tool.poetry"). The gate now calls
declares_tool_poetry, and the substring copy is gone. A real
[tool.poetry] table, or only a [tool.poetry.dependencies] subtable,
is still Poetry's.

utils::toml_edit_ext::has_table, which the issue names as a third probe,
is a vendor-side header check for [tool.uv] with its own tests and
callers. It does not decide Poetry ownership, so it is left alone to keep
this change to one rule.

Test evidence

Issue Regression test Before fix After fix
#1916 crawlers::python_crawler::tests::poetry_plugin_table_does_not_claim_a_lockless_uv_project (plugin table, commented header, [tool.poetry_bumpversion]; real [tool.poetry] / subtable still Poetry's) FAILED at the first plugin-table assertion (commit 04a9d08) ok (9a495bd)

Commands run locally on 9a495bd:

  • cargo fmt --all -- --check: clean
  • cargo clippy --workspace --all-features -- -D warnings: clean
  • cargo test -p socket-patch-core --all-features (lib + tests/crawler_python_e2e.rs and the other core suites): 6996 passed, 4 failed. All 4 are permission-denial tests (copy_tree::relax_loop_must_not_traverse_symlinked_root, vlt_heal::an_unremovable_hidden_lock_keeps_every_store_entry, pypi_poetry::wire_write_failure_maps_error_and_leaves_lock_untouched, pypi_requirements::wire_failure_rolls_back_already_written_files). They rely on 0o555 dirs, which root bypasses, and this container runs as root. None touch the changed code; CI runs non-root.
  • The CLI integration suites were not built locally because there was not enough disk space for every test binary. CI covers them. No CLI or wrapper (npm/, pypi/, gem/) code changes; this is crawler-internal.

https://claude.ai/code/session_011f9aeSt8zoQzfzrLCyqUHv


Generated by Claude Code

Assisted-by: Claude Code:claude-opus-5-5
A lockless uv project whose pyproject.toml carries a Poetry plugin
table such as [tool.poetry-dynamic-versioning] must still have its
UV_PROJECT_ENVIRONMENT crawled. Fails until the lockless-uv gate
reads the parsed [tool.poetry] table (#1916).

Assisted-by: Claude Code:claude-opus-5-5
A lockless uv project that uses a Poetry plugin such as
poetry-dynamic-versioning was mistaken for a Poetry project, because
the check looked for the text "[tool.poetry" anywhere in
pyproject.toml (plugin tables and comments included). Its
UV_PROJECT_ENVIRONMENT was then never crawled, so scan, apply and VEX
missed every package installed there.

The check now reads the parsed [tool.poetry] table, the same rule
Poetry env discovery already uses.

Fixes #1916

Assisted-by: Claude Code:claude-opus-5-5
@mikolalysenko Mikola Lysenko (mikolalysenko) added the Ready for review Agent-verified: mergeable, CI green, Bugbot clean — awaiting human review label Nov 1, 2026
@mikolalysenko

Copy link
Copy Markdown
Collaborator Author

Labeled Ready for review by the burn-down agent.

  • Head: 9a495bd8
  • CI: 31/31 green (50 skipped, 1 neutral), mergeable
  • Bugbot: reviewed 9a495bd8, no findings; no open review threads
  • Reviewer focus: python_crawler.rs — the uv/Poetry ownership check now looks at real [tool.poetry] tables rather than a substring, so Poetry plugin tables no longer hide a uv project.

Slack announcement could not be sent in this run (no Slack send tool available); the next run will retry.


Generated by Claude Code

@mikolalysenko

Copy link
Copy Markdown
Collaborator Author

BugBot review


Generated by Claude Code

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for 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 9a495bd. Configure here.

@mikolalysenko

Copy link
Copy Markdown
Collaborator Author

Final review brief (9a495bd)

What it does: A lockless uv project whose pyproject.toml has a Poetry plugin table ([tool.poetry-dynamic-versioning], common with non-Poetry backends) or even a commented-out # [tool.poetry] line was treated as Poetry's. Its UV_PROJECT_ENVIRONMENT was then never crawled (#1916). The gate now uses the existing TOML-parsing declares_tool_poetry instead of a contains("[tool.poetry") substring check.

Risk: low. A one-line change in one crawler gate, reusing the helper Poetry env discovery already uses. A real [tool.poetry] table, or only a [tool.poetry.*] subtable, still counts as Poetry's. A pyproject.toml that isn't valid TOML no longer counts as Poetry's (uv can't use it either).

Look here:

  • python_crawler.rs:1065:`` the gate now calls declares_tool_poetry
  • python_crawler.rs:2284:``` declares_tool_poetry (unchanged) checks for a parsed `tool.poetry` key
  • python_crawler.rs:5125:```` the regression test (three non-Poetry and three Poetry pyproject.toml shapes)

Verified: Read the full diff (1 file, +50/-3). The test fails on the old substring check for the plugin-table, comment and [tool.poetry_bumpversion] cases. The gate also feeds uv_owns_project_env, which gets the same fix. No other substring [tool.poetry probe is left in crates/. CI: ci-ok and clippy green, 31/31 ran checks pass (50 skipped by path filters, Bugbot neutral). Bugbot reviewed this head with no findings, and there are no open review threads. CHANGELOG.md is untouched. I didn't run tests locally; CI covers the change.

Changes I made: none.

Auto-merge is armed, so approving sends it straight to the merge queue.


Generated by Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Ready for review Agent-verified: mergeable, CI green, Bugbot clean — awaiting human review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

A lockless uv project with a Poetry plugin table loses its UV_PROJECT_ENVIRONMENT packages: "is this Poetry" is read three ways

2 participants