Skip to content

Add a shared pyproject.toml parser crate - #886

Draft
zaniebot wants to merge 6 commits into
mainfrom
zb/uv-pyproject-toml
Draft

zaniebot wants to merge 6 commits into
mainfrom
zb/uv-pyproject-toml

Conversation

@zaniebot

@zaniebot zaniebot commented Aug 26, 2026 •

Copy link
Copy Markdown
Collaborator

Introduce uv-pyproject-toml as a reusable parser for the standardized pyproject.toml tables. The concrete data model is derived from PyO3's pyproject-toml crate and uses uv's normalized names and PEP 440/508 types, while generic wire types let callers retain raw strings, specialized map types, and their existing TOML parser. Filesystem access, tool-specific configuration, and build-backend policy remain with callers.

Adopt the shared schema across uv-build-backend, uv-build-frontend, uv-workspace, and uv-pypi-types, including the existing PEP 735 dependency-group representation. This gives Ruff and other consumers a path away from the legacy pep440_rs and pep508_rs graph while preserving uv's specialized parsing and deferred-validation paths.

@zaniebot
zaniebot force-pushed the zb/uv-pyproject-toml branch from 66a1e86 to a794337 Compare August 26, 2026 22:03
@astral-automations-bot astral-automations-bot Bot added the area:rustlib Related to our Rust library API label Aug 28, 2026
@astral-automations-bot
astral-automations-bot Bot force-pushed the zb/uv-pyproject-toml branch 4 times, most recently from 154dd16 to 9cd62fd Compare September 4, 2026 21:56
@astral-automations-bot
astral-automations-bot Bot force-pushed the zb/uv-pyproject-toml branch 2 times, most recently from 753a28c to 87c74e9 Compare September 9, 2026 16:04
@zaniebot zaniebot added priority:3 Normal: useful features, documentation, usability, or routine efficiency improvements. size:4 Complex: architectural or security-sensitive work requiring broad or cross-repository context. labels Sep 9, 2026
@zaniebot zaniebot added the risk:3 Credible risk of meaningful incorrect behavior or regression; bounded or recoverable. label Sep 11, 2026
@codspeed

codspeed Bot commented Sep 15, 2026 •

Copy link
Copy Markdown

Merging this PR will improve performance by 11.17%

⚠️ 8 benchmarks spent significant time in system calls

System calls cannot be consistently instrumented, so they are not included in the measure, which understates the real cost. Please switch to the Walltime instrument to accurately measure system calls.

Measurement and system calls

⚠️ Different runtime environments detected

Some benchmarks with significant performance changes were compared across different runtime environments,
which may affect the accuracy of the results.

Open the report in CodSpeed to investigate

⚡ 1 improved benchmark
✅ 68 untouched benchmarks
⏩ 35 skipped benchmarks1

Performance Changes

Mode Benchmark BASE HEAD Efficiency
⚡ ⚠️ Simulation discover_workspace_from_all_members_with_excludes 165.6 ms 148.9 ms +11.17%

Tip

Curious why performance improved? Comment @codspeedbot explain why performance improved on this PR, or directly use the CodSpeed MCP with your agent.


Comparing zb/uv-pyproject-toml (fe61e67) with main (64e2ac8)

Open in CodSpeed

Footnotes

  1. 35 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩

@astral-automations-bot
astral-automations-bot Bot force-pushed the zb/uv-pyproject-toml branch 2 times, most recently from e400809 to b171ca2 Compare September 17, 2026 23:34
@astral-automations-bot
astral-automations-bot Bot force-pushed the zb/uv-pyproject-toml branch 4 times, most recently from 50aed22 to 5df68b7 Compare September 24, 2026 21:45
@astral-automations-bot
astral-automations-bot Bot force-pushed the zb/uv-pyproject-toml branch 5 times, most recently from 95ca7df to 0072ae6 Compare October 3, 2026 17:01
@zaniebot zaniebot added the build:skip-release Disable building release binaries for a pull request label Oct 7, 2026
@zaniebot
zaniebot deployed to automations October 9, 2026 16:30 — with GitHub Actions Active
Comment thread .github/workflows/check-lint.yml Outdated
"https://github.com/astral-sh/hawk/releases/download/${HAWK_VERSION}/cargo-hawk-installer.sh" | sh
- name: "Hawk"
run: cargo +1.99.0 hawk check --target-dir target/hawk -D warnings
run: cargo +1.99.0 hawk check --target-dir target/hawk --exclude-crate uv_pyproject_toml -D warnings

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P3] Put the Hawk exemption in the shared configuration

This exclusion applies only in CI; the Hawk command documented in CONTRIBUTING.md still analyzes the new crate’s intentionally public parser API. Local and CI checks therefore apply different visibility policies. Move the justified exclusion or targeted expectations into hawk.toml, alongside the existing downstream API exemptions, and remove the command-only flag so both checks use the same policy.

@zaniebot
zaniebot deployed to automations October 9, 2026 17:25 — with GitHub Actions Active
@astral-automations-bot
astral-automations-bot Bot force-pushed the zb/uv-pyproject-toml branch 2 times, most recently from 9803f20 to f6cdfe9 Compare October 9, 2026 19:33

This branch was successfully deployed

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

Labels

area:rustlib Related to our Rust library API build:skip-release Disable building release binaries for a pull request priority:3 Normal: useful features, documentation, usability, or routine efficiency improvements. risk:3 Credible risk of meaningful incorrect behavior or regression; bounded or recoverable. size:4 Complex: architectural or security-sensitive work requiring broad or cross-repository context.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants