Fix formatting

This commit is contained in:
Alessandro De Maria 2025-07-05 23:10:13 +00:00
parent a7fbe5ae3b
commit 91cb09afc4
5 changed files with 33 additions and 25 deletions

View file

@ -16,16 +16,16 @@ use uv_pep508::MarkerTree;
use uv_pypi_types::ConflictItem;
use crate::graph_ops::{Reachable, marker_reachability};
pub use crate::lock::export::pex_lock::PexLock;
pub(crate) use crate::lock::export::pylock_toml::PylockTomlPackage;
pub use crate::lock::export::pylock_toml::{PylockToml, PylockTomlErrorKind};
pub use crate::lock::export::requirements_txt::RequirementsTxtExport;
pub use crate::lock::export::pex_lock::PexLock;
use crate::universal_marker::resolve_conflicts;
use crate::{Installable, Package};
mod pex_lock;
mod pylock_toml;
mod requirements_txt;
mod pex_lock;
/// A flat requirement, with its associated marker.
#[derive(Debug, Clone, PartialEq, Eq)]

View file

@ -102,7 +102,10 @@ impl PexLock {
let hash_value = hash_str[colon_pos + 1..].to_string();
(algorithm, hash_value)
} else {
(Self::DEFAULT_HASH_ALGORITHM.to_string(), hash_str.to_string())
(
Self::DEFAULT_HASH_ALGORITHM.to_string(),
hash_str.to_string(),
)
}
}
@ -114,7 +117,9 @@ impl PexLock {
// Collect root requirements
if let Some(root) = lock.root() {
for dep in &root.dependencies {
if let Some(version) = lock.packages().iter()
if let Some(version) = lock
.packages()
.iter()
.find(|pkg| pkg.id.name == dep.package_id.name)
.and_then(|pkg| pkg.id.version.as_ref())
{
@ -125,7 +130,6 @@ impl PexLock {
// Process all packages for locked requirements
for package in lock.packages() {
// Create locked requirement
let mut artifacts = Vec::new();
@ -187,7 +191,10 @@ impl PexLock {
}
let locked_resolves = vec![PexLockedResolve {
platform_tag: Self::UNIVERSAL_PLATFORM_TAG.iter().map(|s| s.to_string()).collect(),
platform_tag: Self::UNIVERSAL_PLATFORM_TAG
.iter()
.map(|s| s.to_string())
.collect(),
locked_requirements,
}];

View file

@ -697,7 +697,9 @@ pub(crate) async fn pip_compile(
write!(writer, "{}", export.to_toml()?)?;
}
ExportFormat::PexLock => {
return Err(anyhow::anyhow!("PEX lock format is not supported in pip compile"));
return Err(anyhow::anyhow!(
"PEX lock format is not supported in pip compile"
));
}
}

View file

@ -14,7 +14,7 @@ use uv_configuration::{
use uv_normalize::{DefaultExtras, DefaultGroups, PackageName};
use uv_python::{PythonDownloads, PythonPreference, PythonRequest};
use uv_requirements::is_pylock_toml;
use uv_resolver::{PexLock, PylockToml, RequirementsTxtExport, Installable};
use uv_resolver::{Installable, PexLock, PylockToml, RequirementsTxtExport};
use uv_scripts::{Pep723ItemRef, Pep723Script};
use uv_settings::PythonInstallMirrors;
use uv_workspace::{DiscoveryOptions, MemberDiscovery, VirtualProject, Workspace, WorkspaceCache};

View file

@ -4433,4 +4433,3 @@ fn pep_751_https_credentials() -> Result<()> {
Ok(())
}