GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Fix pyproject product detection tables (#1527, #642) by mikolalysenko · Pull Request #1529 · SocketDev/socket-patch

Conversation

@mikolalysenko

@mikolalysenko Mikola Lysenko (mikolalysenko) commented Oct 14, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Collaborator

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

Fixes #1527
Fixes #642

Summary

vex and scan --vex now detect the product for two documented pyproject layouts that failed with product_undetected (exit 2 for vex, exit 1 for scan --vex after it had already rewritten the lock):

  • VEX product detection fails on Poetry 2 projects that declare dynamic = ["version"] with the version in [tool.poetry], so scan --vex exits 1 after rewriting poetry.lock #1527, Poetry 2: [project].name with dynamic = ["version"] and the version in [tool.poetry].version now gives pkg:pypi/[email protected].
  • VEX product detection ignores PDM 0.x's [tool.pdm] name/version, so vex and scan --vex fail with product_undetected on PDM 0.12 projects (after scan has already rewritten pdm.lock) #642, PDM 0.x: the legacy [tool.pdm] name/version table now gives pkg:pypi/[email protected].

Root cause

vex/product.rs::parse_pyproject took name and version from one table only ([project], else [tool.poetry]), each read by a line scanner that needed both keys in that table. It never combined [project].name with Poetry 2's dynamic version, and it never read [tool.pdm].

Fix

  • pyproject.toml is now read with toml_edit, the crate's existing TOML parser, instead of the line scanner. Multi-line dynamic arrays, 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 through formats::text::BOM.
  • Order: [project] name+version. Then, when Poetry builds the project, poetry-core's own merge (Factory.create_poetry): the name is [project].name or else [tool.poetry].name, and the version is [project].version or else [tool.poetry].version. Last comes legacy [tool.pdm].
  • If [project].name and [tool.poetry].name differ, no product is named, because Poetry 2 builds the first and Poetry 1.x the second.
  • "Poetry builds it" means no build-backend is declared, or it is under poetry. or is poetry_dynamic_versioning.backend, and the poetry-dynamic-versioning plugin is not enabled. Under the enabled plugin the version is a placeholder like 0.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.
  • The old scanner's unit tests now run against the new reader through test-only shims.

Not in this PR: scan --vex resolving the product only after it writes is tracked in #1064.

Per-issue checklist

  • VEX product detection fails on Poetry 2 projects that declare dynamic = ["version"] with the version in [tool.poetry], so scan --vex exits 1 after rewriting poetry.lock #1527: 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_backend
  • VEX product detection ignores PDM 0.x's [tool.pdm] name/version, so vex and scan --vex fail with product_undetected on PDM 0.12 projects (after scan has already rewritten pdm.lock) #642: detect_pyproject_pdm_legacy_table (the issue's exact PDM 0.12 pyproject), pyproject_project_wins_over_tool_pdm

Test evidence

  • Red on main: cargo test -p socket-patch-core --all-features --lib vex::product → detect_pyproject_poetry2_dynamic_version, pyproject_poetry2_multiline_dynamic_version and detect_pyproject_pdm_legacy_table FAILED (132 passed, 3 failed).
  • Green on the branch: cargo test -p socket-patch-core --all-features --lib -- vex:: formats::text → 700 passed, 0 failed.
  • cargo fmt --all -- --check and cargo clippy --workspace --all-features -- -D warnings are 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 as wire_failure_rolls_back_already_written_files), and one in e2e_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 touch vex/product.rs. CI runs them as a non-root user.
  • No wrapper (npm/pypi/gem) changes: product detection is in the Rust core only.

/code-review high findings not fixed

  • toml_edit parses TOML 1.1 while tomllib parses 1.0. A pyproject that uses only 1.1 syntax, such as a multi-line inline table or a \e escape, 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

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@claude
Start fix for #1527, #642
d06bac7
Assisted-by: Claude Code:claude-opus-5-5
This was referenced Oct 14, 2026
VEX product detection fails on Poetry 2 projects that declare dynamic = ["version"] with the version in [tool.poetry], so scan --vex exits 1 after rewriting poetry.lock #1527
Closed
VEX product detection ignores PDM 0.x's [tool.pdm] name/version, so vex and scan --vex fail with product_undetected on PDM 0.12 projects (after scan has already rewritten pdm.lock) #642
Closed
@claude
Detect Poetry 2 and PDM 0.x pyproject products
d4d557d
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
Spawn every CLI test child through one hermetic Command builder; 10 test files inherit ambient SOCKET_* today #823
Closed
Swarm health manager log #1382
Open
Claude (claude) added 2 commits October 14, 2026 11:17
@claude
Refuse a BOM'd pyproject through formats::text
d97895a
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
@claude
Trust tool.poetry version only under Poetry
6eba4d9
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
@mikolalysenko
Mikola Lysenko (mikolalysenko) marked this pull request as ready for review October 14, 2026 11:29
@mikolalysenko

Mikola Lysenko (mikolalysenko) commented Oct 14, 2026

Copy link
Copy Markdown
Collaborator Author

BugBot review


Generated by Claude Code

cursor[bot] reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

cursor[bot]
cursor Bot reviewed Oct 14, 2026
View reviewed changes

@cursor cursor Bot left a comment •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for 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.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Tanmay182003
Tanmay Singla (Tanmay182003) reviewed Oct 14, 2026
View reviewed changes
Comment thread crates/socket-patch-core/src/vex/product.rs Resolved

Uh oh!

There was an error while loading. Please reload this page.

@claude
Read Poetry metadata the way poetry-core merges it
66c36d2
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
@mikolalysenko

Mikola Lysenko (mikolalysenko) commented Oct 14, 2026

Copy link
Copy Markdown
Collaborator Author

BugBot review


Generated by Claude Code

cursor[bot] reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

cursor[bot]
cursor Bot reviewed Oct 14, 2026
View reviewed changes

@cursor cursor Bot left a comment

Copy link
Copy Markdown

There was a problem hiding this comment.

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 66c36d2. Configure here.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Tanmay182003
Tanmay Singla (Tanmay182003) approved these changes Oct 14, 2026
View reviewed changes
@mikolalysenko
Mikola Lysenko (mikolalysenko) added this pull request to the merge queue Oct 14, 2026
Merged via the queue into main with commit 9a5929a Oct 14, 2026
54 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@mikolalysenko
Mikola Lysenko (mikolalysenko) deleted the agent/fix-pyproject-product-tables branch October 14, 2026 13:00
This was referenced Oct 14, 2026
CI perf (settings): slow Depot 16-core hosts since 10-13 15:20 add ~1.5–2.5 min to the merge-queue critical path (~0.6k Linux job-min/day) #1512
Open
CI performance dashboard #1182
Open
@mikolalysenko Mikola Lysenko (mikolalysenko) mentioned this pull request Nov 1, 2026
A lockless uv project with a Poetry plugin table loses its UV_PROJECT_ENVIRONMENT packages: "is this Poetry" is read three ways #1916
Closed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@cursor cursor[bot] cursor[bot] left review comments
@Tanmay182003 Tanmay Singla (Tanmay182003) Tanmay182003 approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

VEX product detection fails on Poetry 2 projects that declare dynamic = ["version"] with the version in [tool.poetry], so scan --vex exits 1 after rewriting poetry.lock VEX product detection ignores PDM 0.x's [tool.pdm] name/version, so vex and scan --vex fail with product_undetected on PDM 0.12 projects (after scan has already rewritten pdm.lock)

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@mikolalysenko @Tanmay182003 @claude
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.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.