Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
424 changes: 195 additions & 229 deletions Cargo.lock

Large diffs are not rendered by default.

59 changes: 30 additions & 29 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -199,35 +199,36 @@ typed-path = "0.12.0"
unicode-width = "0.2.2"
url = "2.5"
# uv 0.12.10 publishes these internal crates as 0.0.77.
uv-build-frontend = "0.0.77"
uv-cache = "0.0.77"
uv-cache-info = "0.0.77"
uv-cache-key = "0.0.77"
uv-client = "0.0.77"
uv-configuration = "0.0.77"
uv-dispatch = "0.0.77"
uv-distribution = "0.0.77"
uv-distribution-filename = "0.0.77"
uv-distribution-types = "0.0.77"
uv-errors = "0.0.77"
uv-flags = "0.0.77"
uv-git = "0.0.77"
uv-git-types = "0.0.77"
uv-install-wheel = "0.0.77"
uv-installer = "0.0.77"
uv-normalize = "0.0.77"
uv-pep440 = "0.0.77"
uv-pep508 = "0.0.77"
uv-platform-tags = "0.0.77"
uv-preview = "0.0.77"
uv-pypi-types = "0.0.77"
uv-python = "0.0.77"
uv-redacted = "0.0.77"
uv-requirements = "0.0.77"
uv-requirements-txt = "0.0.77"
uv-resolver = "0.0.77"
uv-types = "0.0.77"
uv-workspace = "0.0.77"
uv-build-frontend = "0.0.86"
uv-cache = "0.0.86"
uv-cache-info = "0.0.86"
uv-cache-key = "0.0.86"
uv-client = "0.0.86"
uv-configuration = "0.0.86"
uv-dispatch = "0.0.86"
uv-distribution = "0.0.86"
uv-distribution-filename = "0.0.86"
uv-distribution-types = "0.0.86"
uv-errors = "0.0.86"
uv-flags = "0.0.86"
uv-git = "0.0.86"
uv-git-types = "0.0.86"
uv-install-wheel = "0.0.86"
uv-installer = "0.0.86"
uv-normalize = "0.0.86"
uv-pep440 = "0.0.86"
uv-pep508 = "0.0.86"
uv-platform-tags = "0.0.86"
uv-preview = "0.0.86"
uv-pypi-types = "0.0.86"
uv-python = "0.0.86"
uv-redacted = "0.0.86"
uv-requirements = "0.0.86"
uv-requirements-txt = "0.0.86"
uv-resolver = "0.0.86"
uv-threads = "0.0.86"
uv-types = "0.0.86"
uv-workspace = "0.0.86"
webpki-root-certs = "1"
which = "8.0.0"
xxhash-rust = "0.8.15"
Expand Down
2 changes: 1 addition & 1 deletion crates/pixi/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,10 @@ tracing-subscriber = { workspace = true }
typed-path = { workspace = true }
url = { workspace = true }
uv-cache = { workspace = true }
uv-configuration = { workspace = true }
uv-installer = { workspace = true }
uv-normalize = { workspace = true }
uv-python = { workspace = true }
uv-threads = { workspace = true }
zip = { workspace = true }

[features]
Expand Down
2 changes: 1 addition & 1 deletion crates/pixi/tests/integration_rust/install_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ use rattler_virtual_packages::{VirtualPackageOverrides, VirtualPackages};
use tempfile::{TempDir, tempdir};
use tokio::{fs, task::JoinSet};
use url::Url;
use uv_configuration::initialize_rayon_once;
use uv_normalize::PackageName;
use uv_python::PythonEnvironment;
use uv_threads::initialize_rayon_once;

use crate::common::pypi_index::PyPIPackage;
use crate::common::{
Expand Down
2 changes: 1 addition & 1 deletion crates/pixi_cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,10 @@ tracing = { workspace = true }
tracing-subscriber = { workspace = true, features = ["env-filter"] }
typed-path = { workspace = true }
url = { workspace = true }
uv-configuration = { workspace = true }
uv-pep508 = { workspace = true }
uv-pypi-types = { workspace = true }
uv-requirements-txt = { workspace = true }
uv-threads = { workspace = true }
which = { workspace = true }
zip = { workspace = true, features = ["deflate", "time"] }

Expand Down
2 changes: 1 addition & 1 deletion crates/pixi_cli/src/exec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ use rattler::{
use rattler_conda_types::{GenericVirtualPackage, MatchSpec, PackageName, Subdir};
use rattler_solve::{SolverImpl, SolverTask, resolvo::Solver};
use reqwest_middleware::ClientWithMiddleware;
use uv_configuration::initialize_rayon_once;
use uv_threads::initialize_rayon_once;

use crate::{cli_config::ChannelsConfig, match_spec_or_path::MatchSpecOrPath, process_exit};

Expand Down
7 changes: 4 additions & 3 deletions crates/pixi_cli/src/import.rs
Original file line number Diff line number Diff line change
Expand Up @@ -231,9 +231,10 @@ async fn import(args: Args, format: &ImportFileFormat) -> miette::Result<()> {
(conda_deps, pypi_deps)
}
ProcessedInput::PypiTxt => {
let reqs_txt = RequirementsTxt::parse(&input_file, workspace.workspace().root())
.await
.into_diagnostic()?;
let reqs_txt =
RequirementsTxt::parse(input_file.as_path(), workspace.workspace().root())
.await
.into_diagnostic()?;
let pypi_deps = convert_uv_requirements_txt_to_pep508(reqs_txt)?;

(vec![], pypi_deps)
Expand Down
1 change: 1 addition & 0 deletions crates/pixi_core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ uv-redacted = { workspace = true }
uv-requirements = { workspace = true }
uv-requirements-txt = { workspace = true }
uv-resolver = { workspace = true }
uv-threads = { workspace = true }
uv-types = { workspace = true }
uv-workspace = { workspace = true }
xxhash-rust = { workspace = true }
Expand Down
13 changes: 12 additions & 1 deletion crates/pixi_core/src/lock_file/resolve/build_dispatch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -299,12 +299,23 @@ pub enum LazyBuildDispatchError {
PythonMissingError { prefix: String },
}

impl uv_errors::Hint for LazyBuildDispatchError {}
impl uv_errors::Hinted for LazyBuildDispatchError {}

impl IsBuildBackendError for LazyBuildDispatchError {
fn is_build_backend_error(&self) -> bool {
false
}

fn is_user_failure(&self) -> bool {
match self {
Self::InstallationRequiredButDisallowed | Self::PythonMissingError { .. } => true,
Self::Uv(err) => err.is_user_failure(),
Self::UvFrontend(err) => err.is_user_failure(),
Self::InitializationError(_)
| Self::ConversionError(_)
| Self::QueryInterpreterError(_) => false,
}
}
}

impl<'a> LazyBuildDispatch<'a> {
Expand Down
47 changes: 15 additions & 32 deletions crates/pixi_core/src/lock_file/resolve/pypi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,13 @@ use rattler_lock::{
use typed_path::Utf8TypedPathBuf;
use url::Url;
use uv_cache_key::RepositoryUrl;
use uv_client::{FlatIndexClient, RegistryClient, RegistryClientBuilder};
use uv_client::{RegistryClient, RegistryClientBuilder};
use uv_configuration::{Constraints, Overrides};
use uv_distribution::DistributionDatabase;
use uv_distribution_types::{
BuiltDist, ConfigSettings, DependencyMetadata, Diagnostic, Dist, FileLocation, HashPolicy,
IndexCapabilities, IndexUrl, Name, RequirementSource, RequiresPython, Resolution, ResolvedDist,
SourceDist, ToUrlError,
BuiltDist, ConfigSettings, DependencyMetadata, Diagnostic, Dist, FileLocation,
IndexCapabilities, IndexUrl, MetadataHashPolicy, Name, RequirementSource, RequiresPython,
Resolution, ResolvedDist, SourceDist, ToUrlError,
};
use uv_git::RepositoryReference;
use uv_install_wheel::LinkMode;
Expand Down Expand Up @@ -94,12 +94,12 @@ fn parse_hashes_from_hash_vec(hashes: &HashDigests) -> Result<Option<PackageHash
for hash in hashes.iter() {
match hash.algorithm() {
HashAlgorithm::Sha256 => {
sha256 = Some(hash.digest.to_string());
sha256 = Some(hash.digest().to_string());
}
HashAlgorithm::Md5 => {
md5 = Some(hash.digest.to_string());
md5 = Some(hash.digest().to_string());
}
HashAlgorithm::Sha384 | HashAlgorithm::Sha512 | HashAlgorithm::Blake2b => {
HashAlgorithm::Sha384 | HashAlgorithm::Sha512 | HashAlgorithm::Blake2b256 => {
// We do not support these algorithms
}
}
Expand Down Expand Up @@ -487,29 +487,11 @@ pub async fn resolve_pypi(
.collect::<Result<Vec<_>, _>>()
}).transpose()?.unwrap_or_default();

let flat_index = {
let flat_index_client = FlatIndexClient::new(
registry_client.cached_client(),
context.connectivity,
&context.cache,
);
let flat_index_urls: Vec<&IndexUrl> = index_locations
.flat_indexes()
.map(|index| index.url())
.collect();
let flat_index_entries = flat_index_client
.fetch_all(flat_index_urls.into_iter())
.await
.into_diagnostic()?;
// Lock-time resolution creates the lock file; there are no locked
// digests to verify against yet.
FlatIndex::from_entries(
flat_index_entries,
Some(&tags),
&HashStrategy::default(),
&build_options,
)
};
// Lock-time resolution creates the lock file; there are no locked
// digests to verify against yet.
let flat_index = FlatIndex::load(&registry_client, &context.cache, &index_locations)
.await
.into_diagnostic()?;

let resolution_mode = match solve_strategy {
SolveStrategy::Highest => ResolutionMode::Highest,
Expand Down Expand Up @@ -649,6 +631,7 @@ pub async fn resolve_pypi(
marker: Default::default(),
source,
groups: Default::default(),
scope: Default::default(),
origin: None,
})
})
Expand Down Expand Up @@ -738,7 +721,6 @@ pub async fn resolve_pypi(
&constraints,
&overrides,
&excludes,
&dependency_metadata,
&hash_strategy,
&lookahead_index,
DistributionDatabase::new(
Expand Down Expand Up @@ -804,6 +786,7 @@ pub async fn resolve_pypi(
&index_locations,
&build_options,
&context.capabilities,
None,
);

let provider = CondaResolverProvider {
Expand Down Expand Up @@ -1197,7 +1180,7 @@ async fn lock_pypi_packages(

let metadata_response = Box::pin(database.get_or_build_wheel_metadata(
&Dist::Source(source.clone()),
HashPolicy::None,
MetadataHashPolicy::default(),
))
.await
.into_diagnostic()?;
Expand Down
6 changes: 3 additions & 3 deletions crates/pixi_core/src/lock_file/resolve/resolver_provider.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ impl<Context: BuildContext> ResolverProvider for CondaResolverProvider<'_, Conte
// Don't think this matters much
// so just fill it up with empty fields
let file = File {
dist_info_metadata: false,
dist_info_metadata: None,
filename: identifier.name.as_normalized().as_ref().into(),
hashes: vec![].into(),
requires_python: None,
Expand All @@ -74,7 +74,6 @@ impl<Context: BuildContext> ResolverProvider for CondaResolverProvider<'_, Conte
}
},
yanked: None,
zstd: None,
};

let source_dist = RegistrySourceDist {
Expand All @@ -90,7 +89,8 @@ impl<Context: BuildContext> ResolverProvider for CondaResolverProvider<'_, Conte
ext: SourceDistExtension::TarGz,
};

let prioritized_dist = PrioritizedDist::from_source(
let mut prioritized_dist = PrioritizedDist::default();
prioritized_dist.insert_source(
source_dist,
Vec::new(),
SourceDistCompatibility::Compatible(HashComparison::Matched),
Expand Down
55 changes: 15 additions & 40 deletions crates/pixi_core/src/lock_file/satisfiability/pypi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,18 @@ use pixi_uv_conversions::{
pypi_options_to_index_locations, to_index_strategy, to_requirements_relative_to,
};
use pypi_modifiers::pypi_marker_env::determine_marker_environment;
use pypi_modifiers::pypi_tags::{get_pypi_tags, is_python_record, macos_deployment_target};
use pypi_modifiers::pypi_tags::{is_python_record, macos_deployment_target};
use rattler_conda_types::GenericVirtualPackage;
use rattler_lock::UrlOrPath;
use typed_path::Utf8TypedPathBuf;
use url::Url;
use uv_client::{FlatIndexClient, RegistryClientBuilder};
use uv_configuration::initialize_rayon_once;
use uv_client::RegistryClientBuilder;
use uv_distribution::DistributionDatabase;
use uv_distribution_types::{ConfigSettings, DependencyMetadata, IndexUrl, RequirementSource};
use uv_distribution_types::{ConfigSettings, DependencyMetadata, RequirementSource};
use uv_git_types::GitReference;
use uv_pypi_types::PyProjectToml;
use uv_resolver::FlatIndex;
use uv_threads::initialize_rayon_once;
use uv_types::HashStrategy;

use super::errors::PlatformUnsat;
Expand Down Expand Up @@ -694,42 +694,16 @@ async fn read_local_package_metadata(
)
};

// Get tags for this platform (needed for FlatIndex)
let tags = get_pypi_tags(ctx.platform, python_record.as_ref()).map_err(|e| {
PlatformUnsat::FailedToReadLocalMetadata(
package_name.clone(),
format!("Failed to determine pypi tags: {e}"),
)
})?;

let flat_index = {
let flat_index_client = FlatIndexClient::new(
registry_client.cached_client(),
ctx.uv_context.connectivity,
&ctx.uv_context.cache,
);
let flat_index_urls: Vec<&IndexUrl> = index_locations
.flat_indexes()
.map(|index| index.url())
.collect();
let flat_index_entries = flat_index_client
.fetch_all(flat_index_urls.into_iter())
.await
.map_err(|e| {
PlatformUnsat::FailedToReadLocalMetadata(
package_name.clone(),
format!("Failed to fetch flat index entries: {e}"),
)
})?;
// Satisfiability compares the lock file against the manifest; the
// build machinery here has no locked digests to verify against.
FlatIndex::from_entries(
flat_index_entries,
Some(&tags),
&HashStrategy::default(),
&build_options,
)
};
// Satisfiability compares the lock file against the manifest; the
// build machinery here has no locked digests to verify against.
let flat_index = FlatIndex::load(&registry_client, &ctx.uv_context.cache, &index_locations)
.await
.map_err(|e| {
PlatformUnsat::FailedToReadLocalMetadata(
package_name.clone(),
format!("Failed to fetch flat index entries: {e}"),
)
})?;

// Source-build metadata is independent of the conda environment, so do not
// include the conda fingerprint here. Only include cache discriminators that
Expand Down Expand Up @@ -1582,6 +1556,7 @@ mod tests {
index: Some(index),
conflict: None,
},
scope: Default::default(),
origin: None,
}
}
Expand Down
2 changes: 1 addition & 1 deletion crates/pixi_core/src/lock_file/satisfiability/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ async fn verify_lock_file_satisfiability(
// that might trigger implicit rayon initialization (e.g. uv's
// DistributionDatabase). Without this, concurrent tests can race
// and trigger a GlobalPoolAlreadyInitialized panic.
uv_configuration::initialize_rayon_once();
uv_threads::initialize_rayon_once();

// Mirror production's load path (`Workspace::load_lock_file`): align the
// lockfile's platform names to the manifest by identity, so stale names
Expand Down
2 changes: 1 addition & 1 deletion crates/pixi_core/src/rayon_primer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use pixi_command_dispatcher::{
PixiSolveEnvironmentSpec, PixiSolveReporter,
};
use pixi_compute_reporters::OperationId;
use uv_configuration::initialize_rayon_once;
use uv_threads::initialize_rayon_once;

#[derive(Default)]
pub struct RayonPrimer {
Expand Down
Loading
Loading