Repository navigation
Fix pyproject product detection tables (#1527, #642) - #1529
Merged
Mikola Lysenko (mikolalysenko) merged 5 commits intoOct 14, 2026
Merged
Conversation
Assisted-by: Claude Code:claude-opus-5-5
This was referenced Oct 14, 2026
vex and scan --vex failed with product_undetected on two documented pyproject layouts, because the name and version had to come from one table: - Poetry 2 keeps the name in [project] and, when version is listed in [project].dynamic, the version in [tool.poetry] (#1527). - PDM 0.x keeps both in the legacy [tool.pdm] table (#642). Read pyproject.toml with toml_edit instead of the line scanner, so multi-line dynamic arrays and dotted keys parse as tomllib parses them, and fall back through both layouts. A BOM'd file still yields no product, as tomllib refuses it. Assisted-by: Claude Code:claude-opus-5-5
This was referenced Oct 14, 2026
Keeps the inline-BOM guard test green: production code names the BOM through the shared formats::text helpers. Assisted-by: Claude Code:claude-opus-5-5
A [tool.poetry].version is a placeholder when poetry-dynamic-versioning is enabled, and a leftover when another backend (hatch-vcs, setuptools-scm) builds the project. VEX now reports no product for those instead of naming a version that is never built. Also reads [project] once and drops comments about the removed line scanner. Assisted-by: Claude Code:claude-opus-5-5
Mikola Lysenko (mikolalysenko)
marked this pull request as ready for review
October 14, 2026 11:29
Collaborator
Author
|
BugBot review Generated by Claude Code |
poetry-core takes the name from [project] or else [tool.poetry], and the version the same way, with no need for version to be dynamic. A [project].name with a static [tool.poetry].version now yields a product, and a [tool.poetry].name that differs from [project].name (Poetry 1.x and 2 would build different names) yields none instead of the legacy name. The poetry-dynamic-versioning backend counts as Poetry when the plugin is not enabled, as it then builds the static version. Assisted-by: Claude Code:claude-opus-5-5
Collaborator
Author
|
BugBot review Generated by Claude Code |
There was a problem hiding this comment.
✅ 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 66c36d2. Configure here.
Tanmay Singla (Tanmay182003)
approved these changes
Oct 14, 2026
Mikola Lysenko (mikolalysenko)
deleted the
agent/fix-pyproject-product-tables
branch
October 14, 2026 13:00
This was referenced Oct 14, 2026
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.
LLM Description written by Claude Code:claude-opus-5-5
Fixes #1527
Fixes #642
Summary
vexandscan --vexnow detect the product for two documented pyproject layouts that failed withproduct_undetected(exit 2 forvex, exit 1 forscan --vexafter it had already rewritten the lock):[project].namewithdynamic = ["version"]and the version in[tool.poetry].versionnow givespkg:pypi/demo@0.3.0.[tool.pdm]name/versiontable now givespkg:pypi/x@0.0.0.Root cause
vex/product.rs::parse_pyprojecttooknameandversionfrom one table only ([project], else[tool.poetry]), each read by a line scanner that needed both keys in that table. It never combined[project].namewith Poetry 2's dynamic version, and it never read[tool.pdm].Fix
dynamicarrays, dotted keys and inline tables now parse the way tomllib parses them. A BOM'd file still yields no product, as before, because tomllib refuses it. The check goes throughformats::text::BOM.[project]name+version. Then, when Poetry builds the project, poetry-core's own merge (Factory.create_poetry): the name is[project].nameor else[tool.poetry].name, and the version is[project].versionor else[tool.poetry].version. Last comes legacy[tool.pdm].[project].nameand[tool.poetry].namediffer, no product is named, because Poetry 2 builds the first and Poetry 1.x the second.build-backendis declared, or it is underpoetry.or ispoetry_dynamic_versioning.backend, and the poetry-dynamic-versioning plugin is not enabled. Under the enabled plugin the version is a placeholder like0.0.0. Under hatch-vcs or setuptools-scm the table is a leftover. In both cases detection names no product rather than a version that is never built.Not in this PR:
scan --vexresolving the product only after it writes is tracked in #1064.Per-issue checklist
detect_pyproject_poetry2_dynamic_version(the issue's exact pyproject),pyproject_poetry2_multiline_dynamic_version,pyproject_static_version_wins_over_tool_poetry_version,pyproject_tool_poetry_version_without_dynamic,pyproject_conflicting_poetry_names_is_none,pyproject_dynamic_versioning_backend_disabled_keeps_static_version,pyproject_dynamic_version_without_tool_poetry_is_none,pyproject_poetry_dynamic_versioning_placeholder_is_none,pyproject_tool_poetry_version_ignored_under_other_backenddetect_pyproject_pdm_legacy_table(the issue's exact PDM 0.12 pyproject),pyproject_project_wins_over_tool_pdmTest evidence
cargo test -p socket-patch-core --all-features --lib vex::product→detect_pyproject_poetry2_dynamic_version,pyproject_poetry2_multiline_dynamic_versionanddetect_pyproject_pdm_legacy_tableFAILED (132 passed, 3 failed).cargo test -p socket-patch-core --all-features --lib -- vex:: formats::text→ 700 passed, 0 failed.cargo fmt --all -- --checkandcargo clippy --workspace --all-features -- -D warningsare clean.cargo test --workspace --all-features --no-fail-fast: everything passes except tests that make a file or directory read-only or unremovable and expect a write to fail (covgap_commands_vendor,in_process_redirect,repair, plus 4 core tests such aswire_failure_rolls_back_already_written_files), and one ine2e_bun_lockb. The sandbox runs as root, where chmod doesn't block writes. The 4 core tests fail the same way without the last two commits, and none of these tests touchvex/product.rs. CI runs them as a non-root user./code-review high findings not fixed
\eescape, would yield a product that pip can't build. That needs a hand-written 1.1-to-1.0 validator, which is far more code than the risk justifies.🤖 Generated with Claude Code
https://claude.ai/code/session_01Ekek5ktEG5b5ujMggdbzyu
Generated by Claude Code