Skip to content

feat(python): add pylock.toml parser#331

Merged
mstykow merged 6 commits intomainfrom
feat/python-pylock-parser
Mar 14, 2026
Merged

feat(python): add pylock.toml parser#331
mstykow merged 6 commits intomainfrom
feat/python-pylock-parser

Conversation

@mstykow
Copy link
Copy Markdown
Owner

@mstykow mstykow commented Mar 14, 2026

Summary

  • add a dedicated PylockTomlParser with a new PypiPylockToml datasource and Python sibling assembly support for both pylock.toml and named pylock.*.toml files
  • cover the parser with TDD for shared-root classification, unique dependency-reference matching, provenance extraction across vcs/directory/archive/sdist/wheels, and golden regression coverage
  • update user-facing and planning docs to list pylock.toml support and remove #116 from the highest-value backlog

Hardening notes

  • dependency references now resolve only when they uniquely identify a single [[packages]] entry
  • named pylock.*.toml files assemble with pyproject.toml just like pylock.toml
  • provenance is preserved for vcs, directory, archive, sdist, and wheels
  • marker inference is intentionally conservative: only simple 'value' in extras and 'value' in dependency_groups membership markers are interpreted, and ambiguous scope propagation collapses to no scope instead of guessing

Verification

  • cargo fmt --all
  • cargo test pylock_toml --lib
  • cargo test --features golden-tests test_parse_pylock_toml_golden --lib
  • cargo test assembly::assemblers::tests::test_every_datasource_id_is_accounted_for --lib
  • cargo test test_assemble_python_pyproject_with_pylock_toml --lib
  • cargo test test_assemble_python_pyproject_with_named_pylock_toml --lib
  • cargo run --quiet --bin generate-supported-formats
  • cargo clippy --all-targets --all-features -- -D warnings
  • cargo build
  • npx prettier --check docs/implementation-plans/package-detection/PARSER_PLAN.md docs/improvements/README.md docs/improvements/pylock-toml-parser.md docs/SUPPORTED_FORMATS.md
  • npx markdownlint-cli2 docs/implementation-plans/package-detection/PARSER_PLAN.md docs/improvements/README.md docs/improvements/pylock-toml-parser.md docs/SUPPORTED_FORMATS.md

Closes #116

mstykow and others added 6 commits March 14, 2026 15:01
Add a dedicated PEP 751 pylock.toml parser for PyPI projects, including a new datasource ID, Python sibling assembly integration, and generated supported-format registration.

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Add unit and golden coverage for pylock.toml parsing, including shared-root classification, ambiguous reference handling, provenance extraction, and realistic lockfile fixtures.

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Add regression coverage for pyproject.toml merging with both pylock.toml and named pylock lockfiles so Python sibling assembly stays stable.

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Keep the crate-level supported-ecosystem summary aligned with the parser surface by listing pylock.toml in the Python format inventory.

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Remove pylock.toml from the parser backlog and document the new beyond-parity parser so planning and improvement docs match the implemented feature set.

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Fail closed when required pylock metadata is missing or unsupported so incomplete lockfiles do not produce partial package extraction.

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
@mstykow mstykow merged commit e4809ee into main Mar 14, 2026
6 checks passed
@mstykow mstykow deleted the feat/python-pylock-parser branch March 14, 2026 15:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support parsing: pylock.toml (PEP 751)

1 participant