diff --git a/crates/rattler_conda_types/src/package/index.rs b/crates/rattler_conda_types/src/package/index.rs index e7bfac055c..17fa4ad787 100644 --- a/crates/rattler_conda_types/src/package/index.rs +++ b/crates/rattler_conda_types/src/package/index.rs @@ -1,11 +1,11 @@ -use std::path::Path; +use std::{collections::BTreeSet, path::Path}; use rattler_macros::sorted; use serde::{Deserialize, Serialize}; use serde_with::{serde_as, skip_serializing_none}; use super::PackageFile; -use crate::{NoArchType, PackageName, VersionWithSource}; +use crate::{NoArchType, PackageName, PackageUrl, VersionWithSource}; /// A representation of the `index.json` file found in package archives. /// @@ -58,6 +58,10 @@ pub struct IndexJson { /// Optionally, the OS the package is build for. pub platform: Option, + /// A list of Package URLs identifying this package. + /// See this CEP: + pub purls: Option>, + /// Optionally a path within the environment of the site-packages directory. /// This field is only present for python interpreter packages. /// This field was introduced with . diff --git a/crates/rattler_conda_types/src/repo_data/mod.rs b/crates/rattler_conda_types/src/repo_data/mod.rs index 38800101ec..790cbd9d44 100644 --- a/crates/rattler_conda_types/src/repo_data/mod.rs +++ b/crates/rattler_conda_types/src/repo_data/mod.rs @@ -170,6 +170,7 @@ pub struct PackageRecord { /// filled in. So later it can be one of the following: /// [`Some(vec![])`] means that the purl is empty and package is not pypi /// one. [`Some([`PackageUrl`])`] means that it is a pypi package. + /// See this CEP: #[serde(default, skip_serializing_if = "Option::is_none")] pub purls: Option>, @@ -515,7 +516,7 @@ impl PackageRecord { timestamp: index.timestamp, track_features: index.track_features, version: index.version, - purls: None, + purls: index.purls, run_exports: None, }) } diff --git a/crates/rattler_conda_types/src/repo_data/patches.rs b/crates/rattler_conda_types/src/repo_data/patches.rs index 72e9906e03..996d1102db 100644 --- a/crates/rattler_conda_types/src/repo_data/patches.rs +++ b/crates/rattler_conda_types/src/repo_data/patches.rs @@ -98,6 +98,7 @@ pub struct PackageRecordPatch { /// Package identifiers of packages that are equivalent to this package but from other /// ecosystems. + /// See this CEP: pub purls: Option>, } diff --git a/crates/rattler_index/src/lib.rs b/crates/rattler_index/src/lib.rs index c781d0a387..f3fa67d892 100644 --- a/crates/rattler_index/src/lib.rs +++ b/crates/rattler_index/src/lib.rs @@ -68,7 +68,7 @@ pub fn package_record_from_index_json( python_site_packages_path: index.python_site_packages_path, legacy_bz2_md5: None, legacy_bz2_size: None, - purls: None, + purls: index.purls, run_exports: None, };