Skip to content

Comments

Add SBOM export support#16523

Merged
woodruffw merged 40 commits intoastral-sh:mainfrom
thomasschafer:sbom-export-support
Nov 20, 2025
Merged

Add SBOM export support#16523
woodruffw merged 40 commits intoastral-sh:mainfrom
thomasschafer:sbom-export-support

Conversation

@thomasschafer
Copy link
Contributor

@thomasschafer thomasschafer commented Oct 30, 2025

Summary

This PR adds a new SBOM format (CycloneDX v1.5 JSON) to the uv export command.

One notable point about the implementation is the use of a synthetic root when using the --all-packages flag. This has been discussed separately in more detail, but on a high level, it is possible for workspace packages to be disconnected from the workspace root, so if we had the workspace root as the root component in the SBOM then in such cases there would be unreachable components, which causes issues with some SBOM tooling. By having a synthetic root we ensure that all components can be reached by traversing from the root of the SBOM.

Screenshot 2025-10-30 at 17 38 49

Resolves #6012

Test Plan

We've tested manually using a variety of uv projects locally, and have added a variety of tests to crates/uv/tests/it/export.rs.

@thomasschafer thomasschafer force-pushed the sbom-export-support branch 3 times, most recently from 31c2e14 to 4d897e8 Compare October 30, 2025 20:28
@konstin konstin requested a review from woodruffw October 31, 2025 09:37
@thomasschafer thomasschafer marked this pull request as ready for review October 31, 2025 09:49
@thomasschafer thomasschafer force-pushed the sbom-export-support branch 5 times, most recently from 9901b84 to e110bcd Compare October 31, 2025 13:19
Copy link
Member

@woodruffw woodruffw left a comment

Choose a reason for hiding this comment

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

Thanks! Some questions and nitpicks 🙂

@thomasschafer thomasschafer force-pushed the sbom-export-support branch 3 times, most recently from 332140c to 8e701cc Compare October 31, 2025 23:40
@woodruffw woodruffw added enhancement New feature or improvement to existing functionality cli Related to the command line interface labels Nov 3, 2025
@thomasschafer thomasschafer force-pushed the sbom-export-support branch 3 times, most recently from c6448e2 to baa1457 Compare November 10, 2025 10:20
Copy link
Member

@woodruffw woodruffw left a comment

Choose a reason for hiding this comment

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

Thanks @thomasschafer! I flagged a couple of additional places in the snapshots that IMO would benefit from smaller trees/more hermeticity, but otherwise this looks pretty good to me.

@thomasschafer thomasschafer force-pushed the sbom-export-support branch 6 times, most recently from af937b0 to 982851b Compare November 13, 2025 17:47
@thomasschafer thomasschafer force-pushed the sbom-export-support branch 2 times, most recently from 88ddbc7 to a3e49e6 Compare November 20, 2025 15:31
@thomasschafer
Copy link
Contributor Author

Thank you both for the comments @konstin and @woodruffw ! Anything else for me to do here?

Copy link
Member

@woodruffw woodruffw left a comment

Choose a reason for hiding this comment

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

Thanks a ton @thomasschafer! We really appreciate your hard work on this.

@woodruffw woodruffw merged commit fd7e6d0 into astral-sh:main Nov 20, 2025
161 checks passed
tmeijn pushed a commit to tmeijn/dotfiles that referenced this pull request Nov 21, 2025
This MR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [astral-sh/uv](https://github.com/astral-sh/uv) | patch | `0.9.10` -> `0.9.11` |

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.11`](https://github.com/astral-sh/uv/blob/HEAD/CHANGELOG.md#0911)

[Compare Source](astral-sh/uv@0.9.10...0.9.11)

Released on 2025-11-20.

##### Python

- Add CPython 3.15.0a2

See the [`python-build-standalone` release notes](https://github.com/astral-sh/python-build-standalone/releases/tag/20251120) for details.

##### Enhancements

- Add SBOM support to `uv export` ([#&#8203;16523](astral-sh/uv#16523))
- Publish to `crates.io` ([#&#8203;16770](astral-sh/uv#16770))

##### Preview features

- Add `uv workspace list --paths` ([#&#8203;16776](astral-sh/uv#16776))
- Fix the preview warning on `uv workspace dir` ([#&#8203;16775](astral-sh/uv#16775))

##### Bug fixes

- Fix `uv init` author serialization via `toml_edit` inline tables ([#&#8203;16778](astral-sh/uv#16778))
- Fix status messages without TTY ([#&#8203;16785](astral-sh/uv#16785))
- Preserve end-of-line comment whitespace when editing `pyproject.toml` ([#&#8203;16734](astral-sh/uv#16734))
- Disable `always-authenticate` when running under Dependabot ([#&#8203;16773](astral-sh/uv#16773))

##### Documentation

- Document the new behavior for free-threaded python versions ([#&#8203;16781](astral-sh/uv#16781))
- Improve note about build system in publish guide ([#&#8203;16788](astral-sh/uv#16788))
- Move do not upload publish note out of the guide into concepts ([#&#8203;16789](astral-sh/uv#16789))

</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:eyJjcmVhdGVkSW5WZXIiOiI0MS4xNzMuMSIsInVwZGF0ZWRJblZlciI6IjQxLjE3My4xIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJSZW5vdmF0ZSBCb3QiXX0=-->
konstin added a commit that referenced this pull request Feb 18, 2026
## Summary

This corrects a comment in the documentation to match the work done in
#16523, and to match the documentation for `--format`, which states:

```
    /// Supports `requirements.txt`, `pylock.toml` (PEP 751) and CycloneDX v1.5 JSON output formats.
```

## Test Plan

N/A

---------

Co-authored-by: konstin <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cli Related to the command line interface enhancement New feature or improvement to existing functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Software Bill of Materials (SBOM) output

5 participants