Skip to content
Open
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
405 changes: 261 additions & 144 deletions Cargo.lock

Large diffs are not rendered by default.

61 changes: 32 additions & 29 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -193,34 +193,36 @@ tracing-subscriber = "=0.3.19"
tracing-test = "0.2"
typed-path = "0.12.0"
url = "2.5"
uv-build-frontend = { git = "https://github.com/astral-sh/uv", tag = "0.11.15" }
uv-cache = { git = "https://github.com/astral-sh/uv", tag = "0.11.15" }
uv-cache-info = { git = "https://github.com/astral-sh/uv", tag = "0.11.15" }
uv-cache-key = { git = "https://github.com/astral-sh/uv", tag = "0.11.15" }
uv-client = { git = "https://github.com/astral-sh/uv", tag = "0.11.15" }
uv-configuration = { git = "https://github.com/astral-sh/uv", tag = "0.11.15" }
uv-dispatch = { git = "https://github.com/astral-sh/uv", tag = "0.11.15" }
uv-distribution = { git = "https://github.com/astral-sh/uv", tag = "0.11.15" }
uv-distribution-filename = { git = "https://github.com/astral-sh/uv", tag = "0.11.15" }
uv-distribution-types = { git = "https://github.com/astral-sh/uv", tag = "0.11.15" }
uv-flags = { git = "https://github.com/astral-sh/uv", tag = "0.11.15" }
uv-git = { git = "https://github.com/astral-sh/uv", tag = "0.11.15" }
uv-git-types = { git = "https://github.com/astral-sh/uv", tag = "0.11.15" }
uv-install-wheel = { git = "https://github.com/astral-sh/uv", tag = "0.11.15" }
uv-installer = { git = "https://github.com/astral-sh/uv", tag = "0.11.15" }
uv-normalize = { git = "https://github.com/astral-sh/uv", tag = "0.11.15" }
uv-pep440 = { git = "https://github.com/astral-sh/uv", tag = "0.11.15" }
uv-pep508 = { git = "https://github.com/astral-sh/uv", tag = "0.11.15" }
uv-platform-tags = { git = "https://github.com/astral-sh/uv", tag = "0.11.15" }
uv-preview = { git = "https://github.com/astral-sh/uv", tag = "0.11.15" }
uv-pypi-types = { git = "https://github.com/astral-sh/uv", tag = "0.11.15" }
uv-python = { git = "https://github.com/astral-sh/uv", tag = "0.11.15" }
uv-redacted = { git = "https://github.com/astral-sh/uv", tag = "0.11.15" }
uv-requirements = { git = "https://github.com/astral-sh/uv", tag = "0.11.15" }
uv-requirements-txt = { git = "https://github.com/astral-sh/uv", tag = "0.11.15" }
uv-resolver = { git = "https://github.com/astral-sh/uv", tag = "0.11.15" }
uv-types = { git = "https://github.com/astral-sh/uv", tag = "0.11.15" }
uv-workspace = { git = "https://github.com/astral-sh/uv", tag = "0.11.15" }
# uv 0.11.28 publishes these internal crates as 0.0.61.
uv-build-frontend = "0.0.61"
uv-cache = "0.0.61"
uv-cache-info = "0.0.61"
uv-cache-key = "0.0.61"
uv-client = "0.0.61"
uv-configuration = "0.0.61"
uv-dispatch = "0.0.61"
uv-distribution = "0.0.61"
uv-distribution-filename = "0.0.61"
uv-distribution-types = "0.0.61"
uv-errors = "0.0.61"
uv-flags = "0.0.61"
uv-git = "0.0.61"
uv-git-types = "0.0.61"
uv-install-wheel = "0.0.61"
uv-installer = "0.0.61"
uv-normalize = "0.0.61"
uv-pep440 = "0.0.61"
uv-pep508 = "0.0.61"
uv-platform-tags = "0.0.61"
uv-preview = "0.0.61"
uv-pypi-types = "0.0.61"
uv-python = "0.0.61"
uv-redacted = "0.0.61"
uv-requirements = "0.0.61"
uv-requirements-txt = "0.0.61"
uv-resolver = "0.0.61"
uv-types = "0.0.61"
uv-workspace = "0.0.61"
webpki-root-certs = "1"
which = "8.0.0"
xxhash-rust = "0.8.15"
Expand Down Expand Up @@ -265,6 +267,7 @@ rattler_build_recipe = { version = "0.1.9" }
rattler_build_types = { version = "0.1.8" }
rattler_build_variant_config = { version = "0.1.9" }


[patch.crates-io]
version-ranges = { git = "https://github.com/astral-sh/pubgrub", rev = "d8efd77673c9a90792da9da31b6c0da7ea8a324b" }

Expand Down Expand Up @@ -306,4 +309,4 @@ panic = "unwind" # needed for backtraces
split-debuginfo = "unpacked"
strip = "none" # or "debuginfo" to separate
# macOS only:
codegen-units = 1 # better line info (slower build, clearer profiles)
codegen-units = 1 # better line info (slower build, clearer profiles)
10 changes: 6 additions & 4 deletions crates/pixi_api/src/workspace/list/package.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,18 +92,20 @@ impl Package {
.location
.file_name()
.and_then(|f| WheelFilename::from_str(f).ok());
// uv 0.11.16 made the `IndexEntry` fields private; use
// the public `index()` / `dist()` accessors instead.
let entry = registry_index.get(name).find(|entry| {
if entry.index.url() != &index {
if entry.index().url() != &index {
return false;
}
if let Some(filename) = &wheel_filename {
&entry.dist.filename == filename
&entry.dist().filename == filename
} else {
Some(&entry.dist.filename.version)
Some(&entry.dist().filename.version)
== to_uv_version(&p.version).ok().as_ref()
}
});
entry.and_then(|e| get_dir_size(&e.dist.path).ok())
entry.and_then(|e| get_dir_size(&e.dist().path).ok())
} else {
get_pypi_location_information(&p.location).0
};
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 @@ -91,6 +91,7 @@ uv-dispatch = { workspace = true }
uv-distribution = { workspace = true }
uv-distribution-filename = { workspace = true }
uv-distribution-types = { workspace = true }
uv-errors = { workspace = true }
uv-git = { workspace = true }
uv-git-types = { workspace = true }
uv-install-wheel = { workspace = true }
Expand Down
3 changes: 2 additions & 1 deletion crates/pixi_core/src/lock_file/package_identifier.rs
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,8 @@ impl PypiPackageIdentifier {
requirement.name.clone(),
)))
}
uv_distribution_types::RequirementSource::Git { .. } => {
uv_distribution_types::RequirementSource::GitDirectory { .. }
| uv_distribution_types::RequirementSource::GitPath { .. } => {
tracing::warn!(
"PyPI requirement: {} as a Git dependency is currently not supported because it is already selected as a conda package",
consts::PYPI_PACKAGE_STYLE.apply_to(requirement.name.as_str())
Expand Down
24 changes: 21 additions & 3 deletions crates/pixi_core/src/lock_file/resolve/build_dispatch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ use uv_configuration::{
use uv_dispatch::{BuildDispatch, BuildDispatchError, SharedState};
use uv_distribution_filename::DistFilename;
use uv_distribution_types::{
CachedDist, ConfigSettings, DependencyMetadata, ExtraBuildRequires, IndexLocations,
IsBuildBackendError, PackageConfigSettings, SourceDist,
CachedDist, ConfigSettings, DependencyMetadata, ExtraBuildRequires, IndexCapabilities,
IndexLocations, IsBuildBackendError, PackageConfigSettings, SourceDist,
};
use uv_distribution_types::{ExtraBuildVariables, Requirement};
use uv_install_wheel::LinkMode;
Expand Down Expand Up @@ -71,6 +71,10 @@ pub struct UvBuildDispatchParams<'a> {
index_strategy: IndexStrategy,
constraints: Constraints,
shared_state: SharedState,
// uv 0.11.16 made `SharedState`'s `capabilities` field inaccessible
// (no public accessor), so carry the index capabilities explicitly for the
// `BuildContext::capabilities` impl.
capabilities: IndexCapabilities,
link_mode: uv_install_wheel::LinkMode,
exclude_newer: Option<ExcludeNewer>,
sources: NoSources,
Expand Down Expand Up @@ -106,6 +110,7 @@ impl<'a> UvBuildDispatchParams<'a> {
hasher,
index_strategy: IndexStrategy::default(),
shared_state: SharedState::default(),
capabilities: IndexCapabilities::default(),
link_mode: LinkMode::default(),
constraints: Constraints::default(),
exclude_newer: None,
Expand All @@ -128,6 +133,12 @@ impl<'a> UvBuildDispatchParams<'a> {
self
}

/// Set the index capabilities exposed via `BuildContext::capabilities`.
pub fn with_capabilities(mut self, capabilities: IndexCapabilities) -> Self {
self.capabilities = capabilities;
self
}

/// Set the source strategy for the build dispatch
pub fn with_no_sources(mut self, sources: NoSources) -> Self {
self.sources = sources;
Expand Down Expand Up @@ -290,6 +301,10 @@ pub enum LazyBuildDispatchError {
PythonMissingError { prefix: String },
}

// uv 0.11.16 added `uv_errors::Hint` as a supertrait of `IsBuildBackendError`.
// pixi's error surfaces no extra hints, so the trait's default (no hints) is fine.
impl uv_errors::Hint for LazyBuildDispatchError {}

impl IsBuildBackendError for LazyBuildDispatchError {
fn is_build_backend_error(&self) -> bool {
false
Expand Down Expand Up @@ -488,7 +503,7 @@ impl BuildContext for LazyBuildDispatch<'_> {
}

fn capabilities(&self) -> &uv_distribution_types::IndexCapabilities {
self.params.shared_state.capabilities()
&self.params.capabilities
}

fn dependency_metadata(&self) -> &uv_distribution_types::DependencyMetadata {
Expand Down Expand Up @@ -543,6 +558,8 @@ impl BuildContext for LazyBuildDispatch<'_> {
source: &'a Path,
subdirectory: Option<&'a Path>,
install_path: &'a Path,
// uv 0.11.16 added `stop_discovery_at` to `BuildContext::setup_build`.
stop_discovery_at: Option<&'a Path>,
version_id: Option<&'a str>,
dist: Option<&'a SourceDist>,
sources: &'a NoSources,
Expand All @@ -555,6 +572,7 @@ impl BuildContext for LazyBuildDispatch<'_> {
source,
subdirectory,
install_path,
stop_discovery_at,
version_id,
dist,
sources,
Expand Down
56 changes: 37 additions & 19 deletions crates/pixi_core/src/lock_file/resolve/pypi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ use uv_resolver::{
PreferenceError, Preferences, PythonRequirement, ResolutionMode, ResolveError, Resolver,
ResolverEnvironment,
};
use uv_types::{EmptyInstalledPackages, HashStrategy};
use uv_types::{BuildContext, EmptyInstalledPackages, HashStrategy};

use crate::{
environment::CondaPrefixUpdated,
Expand Down Expand Up @@ -315,7 +315,7 @@ pub async fn resolve_pypi(
let display_safe_url =
uv_redacted::DisplaySafeUrl::from_url(pinned_git_spec.git.clone());

let repository_url = RepositoryUrl::new(&display_safe_url);
let repository_url = RepositoryUrl::new(display_safe_url);
let reference = RepositoryReference {
url: repository_url,
reference: uv_reference,
Expand Down Expand Up @@ -408,16 +408,16 @@ pub async fn resolve_pypi(
);

let registry_client = {
let base_client_builder = context.base_client_builder(
allow_insecure_hosts,
Some(&marker_environment),
Connectivity::Online,
);
let base_client_builder =
context.base_client_builder(allow_insecure_hosts, Connectivity::Online);

// uv 0.11.16 moved `markers` off `BaseClientBuilder` onto the (still
// public) `RegistryClientBuilder::markers`.
let mut uv_client_builder =
RegistryClientBuilder::new(base_client_builder, context.cache.clone())
.index_locations(index_locations.clone())
.index_strategy(index_strategy);
.index_strategy(index_strategy)
.markers(&marker_environment);

for p in &context.proxies {
uv_client_builder = uv_client_builder.proxy(p.clone())
Expand Down Expand Up @@ -511,6 +511,7 @@ pub async fn resolve_pypi(
)
.with_index_strategy(index_strategy)
.with_exclude_newer(options.exclude_newer.clone())
.with_capabilities(context.capabilities.clone())
.with_workspace_cache(context.workspace_cache.clone())
// Create a forked shared state that condains the in-memory index.
// We need two in-memory indexes, one for the build dispatch and one for the
Expand Down Expand Up @@ -680,6 +681,9 @@ pub async fn resolve_pypi(

let resolution_future = panic::AssertUnwindSafe(async {
let lookahead_index = InMemoryIndex::default();
// uv 0.11.16 added an `excludes` parameter to `LookaheadResolver::new`
// (and `Manifest::new` already takes one). pixi excludes nothing.
let excludes = uv_configuration::Excludes::default();
// uv 0.11.4 changed `LookaheadResolver::resolve` to return both the
// lookaheads and a hash strategy refined by what it discovered along
// the way. We adopt the refined strategy for the downstream resolver
Expand All @@ -689,6 +693,7 @@ pub async fn resolve_pypi(
&requirements,
&constraints,
&overrides,
&excludes,
&HashStrategy::None,
&lookahead_index,
DistributionDatabase::new(
Expand All @@ -711,7 +716,7 @@ pub async fn resolve_pypi(
requirements,
constraints,
overrides,
uv_configuration::Excludes::default(),
excludes.clone(),
Preferences::from_iter(preferences, &resolver_env),
None,
Default::default(),
Expand Down Expand Up @@ -746,6 +751,7 @@ pub async fn resolve_pypi(
// We need a new in-memory index for the resolver so that it does not conflict
// with the build dispatch one. As we have noted in the comment above.
let resolver_in_memory_index = InMemoryIndex::default();
// uv 0.11.16 made `Resolver::new_custom_io` infallible (returns `Self`).
let resolver = Resolver::new_custom_io(
manifest,
options,
Expand All @@ -765,11 +771,6 @@ pub async fn resolve_pypi(
provider,
EmptyInstalledPackages,
)
.into_diagnostic()
.context("failed to resolve pypi dependencies")
.map_err(|e| SolveError::GeneralPanic {
message: format!("Failed to create resolver: {e}"),
})?
.with_reporter(UvReporter::new_arc(
UvReporterOptions::new().with_existing(pb.clone()),
));
Expand Down Expand Up @@ -1014,8 +1015,10 @@ async fn lock_pypi_packages(
)
}

// uv 0.11.16 added `git` and `reporter` parameters to
// `RegistryClient::wheel_metadata`.
let metadata = registry_client
.wheel_metadata(dist, index_capabilities)
.wheel_metadata(dist, pixi_build_dispatch.git(), index_capabilities, None)
.await
.into_diagnostic()
.wrap_err("cannot get wheel metadata")?;
Expand Down Expand Up @@ -1065,6 +1068,11 @@ async fn lock_pypi_packages(
None,
)?);
}
BuiltDist::GitPath(_) => {
// uv's 0.11.16 GitDirectory/GitPath split; pixi never
// produces git-archive built distributions.
unreachable!("pixi does not produce git-archive built distributions")
}
}
}
Dist::Source(source) => {
Expand Down Expand Up @@ -1104,9 +1112,14 @@ async fn lock_pypi_packages(
.lock(locked_version),
)
}
// Handle new hash stuff
let hash = source
.file()
// Handle new hash stuff.
// uv 0.11.16 made `SourceDist::file` a private trait method;
// only registry source dists carry a `File`.
let source_file = match source {
SourceDist::Registry(reg) => Some(&reg.file),
_ => None,
};
let hash = source_file
.and_then(|file| {
parse_hashes_from_hash_vec(&file.hashes)
.into_diagnostic()
Expand Down Expand Up @@ -1151,7 +1164,7 @@ async fn lock_pypi_packages(
&anchor,
)?);
}
SourceDist::Git(git) => {
SourceDist::GitDirectory(git) => {
// Look up the original git reference from the manifest dependencies
// to preserve branch/tag info that uv normalizes away
let package_name = git.name.clone();
Expand Down Expand Up @@ -1231,6 +1244,11 @@ async fn lock_pypi_packages(
.lock(locked_version),
);
}
SourceDist::GitPath(_) => {
// uv's 0.11.16 GitDirectory/GitPath split; pixi never
// produces git-archive source distributions.
unreachable!("pixi does not produce git-archive source distributions")
}
};
}
},
Expand Down
Loading
Loading