Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
3a6ca15
Split out pip compile format options into new enum
thomasschafer Sep 22, 2025
a65dd58
Add CDX export format with empty JSON export
thomasschafer Sep 22, 2025
37d74fd
Export CDX with CDX metadata
snyk-will Sep 23, 2025
8274e2f
Add CDX initial metadata and component list
snyk-will Sep 23, 2025
76323e6
Add test for basic CDX export
snyk-will Sep 23, 2025
0e1dfa7
Add tooling metadata field
snyk-will Sep 23, 2025
d1429cd
Add dependency tree to CDX output
snyk-will Sep 24, 2025
746accb
Tidy up dependency building and imports
thomasschafer Sep 24, 2025
dd6831b
Add tests for git deps and no deps
thomasschafer Sep 24, 2025
0d2bf43
Update docs
thomasschafer Sep 24, 2025
0c82a94
Fix linting errors
thomasschafer Sep 24, 2025
4592502
Add workspace information
thomasschafer Oct 15, 2025
e278b15
Update component lookup
thomasschafer Oct 16, 2025
eb396f1
Move PipCompileFormat into export_format.rs
thomasschafer Sep 25, 2025
a43ee0d
Add markers
thomasschafer Oct 16, 2025
8019a33
Update comments and return &str for package name
thomasschafer Sep 25, 2025
9e2343a
Replace python:environment_marker with uv:marker
thomasschafer Oct 17, 2025
7b55148
Add purl encoding
thomasschafer Sep 29, 2025
370e934
More fixes to properties
thomasschafer Oct 19, 2025
ba1f6b3
Add more tests
thomasschafer Sep 29, 2025
eb41d8a
Merge pull request #5 from thomasschafer/sbom-export-support-2
thomasschafer Oct 27, 2025
05b3b81
docs: uv export documentation
snyk-will Oct 27, 2025
59ddc4d
Guard sbom export behind preview flag
thomasschafer Oct 27, 2025
dc5f895
chore: add preview message
snyk-will Oct 29, 2025
4ba01c7
Update `cdx:python:package:marker` to `uv:package:marker`
thomasschafer Oct 28, 2025
97657ba
fix: resolve conflicts after rebasing
thomasschafer Oct 30, 2025
5b5469a
Update comment
thomasschafer Oct 29, 2025
6ae0e1b
Add preview link to note
thomasschafer Oct 30, 2025
a66f682
Skip conflict detection for SBOMs
thomasschafer Oct 29, 2025
c85ad8d
Merge pull request #6 from thomasschafer/sbom-export-docs
thomasschafer Oct 30, 2025
ecd73ab
Refactor component map
thomasschafer Oct 30, 2025
8845983
Insert synthetic root when using `--all-packages` flag
thomasschafer Oct 30, 2025
8c1cb1f
Fix linting and tests
thomasschafer Oct 30, 2025
bec95bc
Use pypi rather than generic purl type, and naming updates
thomasschafer Oct 31, 2025
c4302c1
Implement Copy on PackageType
thomasschafer Oct 31, 2025
7b3d7ac
Replace `write_fmt` with `Write` implementation
thomasschafer Oct 31, 2025
caac27b
Return error rather than panicking for non-local workspace packages
thomasschafer Nov 5, 2025
3a691fe
Swap anyio with urllib3 in cyclonedx snapshot tests
thomasschafer Nov 5, 2025
ab9d789
Tidy up tests
thomasschafer Nov 13, 2025
ed16beb
Improve and document handling of purls, and other fixes
thomasschafer Nov 18, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
119 changes: 118 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ configparser = { version = "3.1.0" }
console = { version = "0.16.0", default-features = false, features = ["std"] }
csv = { version = "1.3.0" }
ctrlc = { version = "3.4.5" }
cyclonedx-bom = { version = "0.8.0" }
dashmap = { version = "6.1.0" }
data-encoding = { version = "2.6.0" }
dotenvy = { version = "0.15.7" }
Expand Down
9 changes: 5 additions & 4 deletions crates/uv-cli/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ use clap::{Args, Parser, Subcommand};
use uv_auth::Service;
use uv_cache::CacheArgs;
use uv_configuration::{
ExportFormat, IndexStrategy, KeyringProviderType, PackageNameSpecifier, ProjectBuildBackend,
TargetTriple, TrustedHost, TrustedPublishing, VersionControlSystem,
ExportFormat, IndexStrategy, KeyringProviderType, PackageNameSpecifier, PipCompileFormat,
ProjectBuildBackend, TargetTriple, TrustedHost, TrustedPublishing, VersionControlSystem,
};
use uv_distribution_types::{
ConfigSettingEntry, ConfigSettingPackageEntry, Index, IndexUrl, Origin, PipExtraIndex,
Expand Down Expand Up @@ -1442,7 +1442,7 @@ pub struct PipCompileArgs {
/// uv will infer the output format from the file extension of the output file, if
/// provided. Otherwise, defaults to `requirements.txt`.
#[arg(long, value_enum)]
pub format: Option<ExportFormat>,
pub format: Option<PipCompileFormat>,

/// Include extras in the output file.
///
Expand Down Expand Up @@ -4543,9 +4543,10 @@ pub struct TreeArgs {

#[derive(Args)]
pub struct ExportArgs {
#[allow(clippy::doc_markdown)]
/// The format to which `uv.lock` should be exported.
///
/// Supports both `requirements.txt` and `pylock.toml` (PEP 751) output formats.
/// Supports `requirements.txt`, `pylock.toml` (PEP 751) and CycloneDX v1.5 JSON output formats.
///
/// uv will infer the output format from the file extension of the output file, if
/// provided. Otherwise, defaults to `requirements.txt`.
Expand Down
26 changes: 26 additions & 0 deletions crates/uv-configuration/src/export_format.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,30 @@ pub enum ExportFormat {
#[serde(rename = "pylock.toml", alias = "pylock-toml")]
#[cfg_attr(feature = "clap", clap(name = "pylock.toml", alias = "pylock-toml"))]
PylockToml,
/// Export in `CycloneDX` v1.5 JSON format.
#[serde(rename = "cyclonedx1.5")]
#[cfg_attr(
feature = "clap",
clap(name = "cyclonedx1.5", alias = "cyclonedx1.5+json")
)]
CycloneDX1_5,
}

/// The output format to use in `uv pip compile`.
#[derive(Debug, Default, Clone, Copy, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
#[serde(deny_unknown_fields, rename_all = "kebab-case")]
#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
pub enum PipCompileFormat {
/// Export in `requirements.txt` format.
#[default]
#[serde(rename = "requirements.txt", alias = "requirements-txt")]
#[cfg_attr(
feature = "clap",
clap(name = "requirements.txt", alias = "requirements-txt")
)]
RequirementsTxt,
/// Export in `pylock.toml` format.
#[serde(rename = "pylock.toml", alias = "pylock-toml")]
#[cfg_attr(feature = "clap", clap(name = "pylock.toml", alias = "pylock-toml"))]
PylockToml,
}
4 changes: 4 additions & 0 deletions crates/uv-preview/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ bitflags::bitflags! {
const WORKSPACE_METADATA = 1 << 13;
const WORKSPACE_DIR = 1 << 14;
const WORKSPACE_LIST = 1 << 15;
const SBOM_EXPORT = 1 << 16;
}
}

Expand All @@ -50,6 +51,7 @@ impl PreviewFeatures {
Self::WORKSPACE_METADATA => "workspace-metadata",
Self::WORKSPACE_DIR => "workspace-dir",
Self::WORKSPACE_LIST => "workspace-list",
Self::SBOM_EXPORT => "sbom-export",
_ => panic!("`flag_as_str` can only be used for exactly one feature flag"),
}
}
Expand Down Expand Up @@ -103,6 +105,7 @@ impl FromStr for PreviewFeatures {
"workspace-metadata" => Self::WORKSPACE_METADATA,
"workspace-dir" => Self::WORKSPACE_DIR,
"workspace-list" => Self::WORKSPACE_LIST,
"sbom-export" => Self::SBOM_EXPORT,
_ => {
warn_user_once!("Unknown preview feature: `{part}`");
continue;
Expand Down Expand Up @@ -278,6 +281,7 @@ mod tests {
);
assert_eq!(PreviewFeatures::FORMAT.flag_as_str(), "format");
assert_eq!(PreviewFeatures::S3_ENDPOINT.flag_as_str(), "s3-endpoint");
assert_eq!(PreviewFeatures::SBOM_EXPORT.flag_as_str(), "sbom-export");
}

#[test]
Expand Down
4 changes: 4 additions & 0 deletions crates/uv-resolver/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ uv-once-map = { workspace = true }
uv-pep440 = { workspace = true }
uv-pep508 = { workspace = true }
uv-platform-tags = { workspace = true }
uv-preview = { workspace = true }
uv-pypi-types = { workspace = true }
uv-python = { workspace = true }
uv-redacted = { workspace = true }
Expand All @@ -41,11 +42,13 @@ uv-small-str = { workspace = true }
uv-static = { workspace = true }
uv-torch = { workspace = true }
uv-types = { workspace = true }
uv-version = { workspace = true }
uv-warnings = { workspace = true }
uv-workspace = { workspace = true }

arcstr = { workspace = true }
clap = { workspace = true, features = ["derive"], optional = true }
cyclonedx-bom = { workspace = true }
dashmap = { workspace = true }
either = { workspace = true }
fs-err = { workspace = true, features = ["tokio"] }
Expand All @@ -55,6 +58,7 @@ indexmap = { workspace = true }
itertools = { workspace = true }
jiff = { workspace = true, features = ["serde"] }
owo-colors = { workspace = true }
percent-encoding = { workspace = true }
petgraph = { workspace = true }
pubgrub = { workspace = true }
rkyv = { workspace = true }
Expand Down
2 changes: 1 addition & 1 deletion crates/uv-resolver/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ pub use fork_strategy::ForkStrategy;
pub use lock::{
Installable, Lock, LockError, LockVersion, Package, PackageMap, PylockToml,
PylockTomlErrorKind, RequirementsTxtExport, ResolverManifest, SatisfiesResult, TreeDisplay,
VERSION,
VERSION, cyclonedx_json,
};
pub use manifest::Manifest;
pub use options::{Flexibility, Options, OptionsBuilder};
Expand Down
Loading
Loading