Skip to content

Conversation

@konstin
Copy link
Member

@konstin konstin commented Aug 25, 2025

https://discuss.python.org/t/pep-819-json-package-metadata/105558

Add an experimental JSON format for METADATA and WHEEL files in the uv build backend to have a reference what it would look like and to demonstrate that the actual change is just a few lines, how much easier it is than the existing email header format.

The change is overwhelmingly adding the preview feature as it's the first preview item in the build backend, writing the actual JSON is only a couple of lines.

@konstin konstin added preview Experimental behavior build-backend labels Aug 25, 2025
@konstin konstin changed the title Add METADATA.json and WHEEL.json to build backend Add METADATA.json and WHEEL.json in uv build backend Aug 25, 2025
@konstin konstin temporarily deployed to uv-test-registries August 25, 2025 08:38 — with GitHub Actions Inactive
@konstin
Copy link
Member Author

konstin commented Aug 26, 2025

Before merging, we need to extend this to include the full transformations from https://peps.python.org/pep-0566/#json-compatible-metadata

@konstin konstin force-pushed the konsti/json-metadata branch 3 times, most recently from 543cf4c to 7f0fbb5 Compare December 17, 2025 18:57
@konstin konstin temporarily deployed to uv-test-registries December 17, 2025 19:00 — with GitHub Actions Inactive
@konstin konstin force-pushed the konsti/json-metadata branch from 7f0fbb5 to 4b8ab58 Compare December 17, 2025 19:05
@konstin konstin temporarily deployed to uv-test-registries December 17, 2025 19:07 — with GitHub Actions Inactive
@konstin konstin force-pushed the konsti/json-metadata branch 2 times, most recently from 79370bc to fa0140e Compare January 6, 2026 12:08
@konstin konstin marked this pull request as ready for review January 6, 2026 12:09
@konstin
Copy link
Member Author

konstin commented Jan 6, 2026

PEP 819 is up, so I'd like to merge this as a preview feature.

@konstin konstin temporarily deployed to uv-test-registries January 6, 2026 12:10 — with GitHub Actions Inactive
@konstin konstin temporarily deployed to uv-test-publish January 6, 2026 12:11 — with GitHub Actions Inactive
@konstin konstin force-pushed the konsti/json-metadata branch 2 times, most recently from 78b3946 to ce55fb5 Compare January 8, 2026 12:00
@konstin konstin temporarily deployed to uv-test-registries January 8, 2026 12:08 — with GitHub Actions Inactive
@konstin konstin temporarily deployed to uv-test-publish January 8, 2026 12:08 — with GitHub Actions Inactive
@konstin konstin requested a review from EliteTK January 9, 2026 12:15
@konstin konstin force-pushed the konsti/json-metadata branch from ce55fb5 to 87512b3 Compare January 9, 2026 12:40
Copy link
Contributor

@EliteTK EliteTK left a comment

Choose a reason for hiding this comment

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

Fun fact:

This PR adds 88 (118) new instances of the word "preview" to uv. For a grand total of 1525 (1935) instances. (Counts in brackets are when just searching for "preview" rather than for words.)

Comment on lines +333 to +359
/// Read the `METADATA` format.
pub fn from_iter_str(project_urls: impl IntoIterator<Item = String>) -> Self {
Self(
project_urls
.into_iter()
.map(|project_url| {
let (label, url) = project_url.split_once(',').unwrap_or((&project_url, ""));
// TODO(konsti): The spec says separated by comma, but it's actually comma and a
// space.
(label.trim().to_string(), url.trim().to_string())
})
.collect(),
)
}

/// Write the `METADATA` format.
pub fn to_vec_str(&self) -> Vec<String> {
self.0
.iter()
.map(|(label, url)| format!("{label}, {url}"))
.collect()
}
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: I think this parsing and serialisation belongs in a ProjectUrl type. But I can see how that would be a bit of churn due to the overarching need for IndexMap.

charliermarsh and others added 3 commits January 14, 2026 17:45
Add an experimental JSON format for METADATA and WHEEL files in the uv build backend to have a reference what it would look like and to demonstrate that the actual change is just a few lines, how much easier it is than the existing email-ish format.
@konstin konstin force-pushed the konsti/json-metadata branch from 072b9e2 to bb8c1ba Compare January 14, 2026 16:46
@konstin konstin enabled auto-merge (squash) January 14, 2026 16:55
@konstin konstin temporarily deployed to uv-test-publish January 14, 2026 17:11 — with GitHub Actions Inactive
@konstin konstin temporarily deployed to uv-test-registries January 14, 2026 17:11 — with GitHub Actions Inactive
@konstin konstin temporarily deployed to uv-test-publish January 14, 2026 18:52 — with GitHub Actions Inactive
@konstin konstin temporarily deployed to uv-test-registries January 14, 2026 18:52 — with GitHub Actions Inactive
@konstin konstin merged commit 0ab603e into main Jan 14, 2026
165 checks passed
@konstin konstin deleted the konsti/json-metadata branch January 14, 2026 18:52
tmeijn pushed a commit to tmeijn/dotfiles that referenced this pull request Jan 17, 2026
This MR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [astral-sh/uv](https://github.com/astral-sh/uv) | patch | `0.9.24` → `0.9.26` |

MR created with the help of [el-capitano/tools/renovate-bot](https://gitlab.com/el-capitano/tools/renovate-bot).

**Proposed changes to behavior should be submitted there as MRs.**

---

### Release Notes

<details>
<summary>astral-sh/uv (astral-sh/uv)</summary>

### [`v0.9.26`](https://github.com/astral-sh/uv/blob/HEAD/CHANGELOG.md#0926)

[Compare Source](astral-sh/uv@0.9.25...0.9.26)

Released on 2026-01-15.

##### Python

- Add CPython 3.15.0a5

##### Enhancements

- Add a hint to update uv when a managed Python download is not found ([#&#8203;17461](astral-sh/uv#17461))
- Improve cache initialization failure error message ([#&#8203;17469](astral-sh/uv#17469))
- Improve error message for abi3 wheels on free-threaded Python ([#&#8203;17442](astral-sh/uv#17442))
- Add support for `--no-sources-package` ([#&#8203;14910](astral-sh/uv#14910))

##### Preview features

- Add `METADATA.json` and `WHEEL.json` in uv build backend ([#&#8203;15510](astral-sh/uv#15510))
- Add support for GCS request signing ([#&#8203;17474](astral-sh/uv#17474))
- Adjust the process ulimit to the maximum allowed on startup ([#&#8203;17464](astral-sh/uv#17464))

##### Bug fixes

- Lock to avoid concurrent refresh of pyx tokens ([#&#8203;17479](astral-sh/uv#17479))

##### Documentation

- Add linting and formatting instructions to the CONTRIBUTING guide ([#&#8203;17470](astral-sh/uv#17470))
- Avoid rendering `pyproject.toml` examples for more system-level settings ([#&#8203;17462](astral-sh/uv#17462))

### [`v0.9.25`](https://github.com/astral-sh/uv/blob/HEAD/CHANGELOG.md#0925)

[Compare Source](astral-sh/uv@0.9.24...0.9.25)

Released on 2026-01-13.

##### Python

- Add CPython 3.15.0a4
- Upgrade Tcl/Tk used by CPython to 9.0

##### Enhancements

- Add `--compile-bytecode` to `uv python install` and `uv python upgrade` to compile the standard library ([#&#8203;17088](astral-sh/uv#17088))
- Allow disabling `exclude-newer` per package ([#&#8203;16854](astral-sh/uv#16854))
- Broadcast `WM_SETTINGCHANGE` on `uv tool update-shell` ([#&#8203;17404](astral-sh/uv#17404))

##### Preview features

- Detect workspace from `uv run` target ([#&#8203;17423](astral-sh/uv#17423))

##### Bug fixes

- Avoid unwrapping size for file responses ([#&#8203;17434](astral-sh/uv#17434))
- Use keyring authentication when retrieving `tool@latest` version ([#&#8203;17448](astral-sh/uv#17448))
- Use latest Pyodide version for each python version ([#&#8203;17372](astral-sh/uv#17372))
- Improve trampoline file handle closing ([#&#8203;17374](astral-sh/uv#17374))
- Fix error message when installing musl python on armv7 ([#&#8203;17213](astral-sh/uv#17213))

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever MR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this MR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this MR, check this box

---

This MR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0Mi44MC4xIiwidXBkYXRlZEluVmVyIjoiNDIuODEuOCIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOlsiUmVub3ZhdGUgQm90IiwiYXV0b21hdGlvbjpib3QtYXV0aG9yZWQiLCJkZXBlbmRlbmN5LXR5cGU6OnBhdGNoIl19-->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build-backend preview Experimental behavior

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants