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
873 changes: 521 additions & 352 deletions Cargo.lock

Large diffs are not rendered by default.

74 changes: 35 additions & 39 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ homepage = "https://github.com/prefix-dev/pixi"
license = "BSD-3-Clause"
readme = "README.md"
repository = "https://github.com/prefix-dev/pixi"
rust-version = "1.90"
rust-version = "1.91"

[workspace.dependencies]
ahash = "0.8.11"
Expand Down Expand Up @@ -138,16 +138,14 @@ pypi_modifiers = { path = "crates/pypi_modifiers" }
pyproject-toml = "0.13.7"
rand = { version = "0.9.1", default-features = false }

bzip2 = "0.6.1"
rayon = "1.10.0"
recipe-stage0 = { path = "crates/recipe-stage0" }
regex = "1.11.1"
reqwest = { version = "0.12.12", default-features = false }
retry-policies = "0.4"
# reqwest-middleware = "0.4"
# reqwest-retry = "0.7.0"
bzip2 = "0.6.1"
reqwest-middleware = { git = "https://github.com/astral-sh/reqwest-middleware", rev = "7650ed76215a962a96d94a79be71c27bffde7ab2" }
reqwest-retry = { git = "https://github.com/astral-sh/reqwest-middleware", rev = "7650ed76215a962a96d94a79be71c27bffde7ab2" }
reqwest-middleware = { package = "astral-reqwest-middleware", version = "0.4.2" }
reqwest-retry = { package = "astral-reqwest-retry", version = "0.8.0" }
retry-policies = "0.5.1"
rlimit = "0.10.2"
rstest = "0.26.0"
same-file = "1.0.6"
Expand Down Expand Up @@ -187,35 +185,34 @@ tracing-test = "0.2"
typed-path = "0.12.0"
# Bumping this to a higher version breaks the Windows path handling.
url = "2.5.4"
uv-auth = { git = "https://github.com/astral-sh/uv", tag = "0.9.5" }
uv-build-frontend = { git = "https://github.com/astral-sh/uv", tag = "0.9.5" }
uv-cache = { git = "https://github.com/astral-sh/uv", tag = "0.9.5" }
uv-cache-info = { git = "https://github.com/astral-sh/uv", tag = "0.9.5" }
uv-cache-key = { git = "https://github.com/astral-sh/uv", tag = "0.9.5" }
uv-client = { git = "https://github.com/astral-sh/uv", tag = "0.9.5" }
uv-configuration = { git = "https://github.com/astral-sh/uv", tag = "0.9.5" }
uv-dispatch = { git = "https://github.com/astral-sh/uv", tag = "0.9.5" }
uv-distribution = { git = "https://github.com/astral-sh/uv", tag = "0.9.5" }
uv-distribution-filename = { git = "https://github.com/astral-sh/uv", tag = "0.9.5" }
uv-distribution-types = { git = "https://github.com/astral-sh/uv", tag = "0.9.5" }
uv-flags = { git = "https://github.com/astral-sh/uv", tag = "0.9.5" }
uv-git = { git = "https://github.com/astral-sh/uv", tag = "0.9.5" }
uv-git-types = { git = "https://github.com/astral-sh/uv", tag = "0.9.5" }
uv-install-wheel = { git = "https://github.com/astral-sh/uv", tag = "0.9.5" }
uv-installer = { git = "https://github.com/astral-sh/uv", tag = "0.9.5" }
uv-normalize = { git = "https://github.com/astral-sh/uv", tag = "0.9.5" }
uv-pep440 = { git = "https://github.com/astral-sh/uv", tag = "0.9.5" }
uv-pep508 = { git = "https://github.com/astral-sh/uv", tag = "0.9.5" }
uv-platform-tags = { git = "https://github.com/astral-sh/uv", tag = "0.9.5" }
uv-preview = { git = "https://github.com/astral-sh/uv", tag = "0.9.5" }
uv-pypi-types = { git = "https://github.com/astral-sh/uv", tag = "0.9.5" }
uv-python = { git = "https://github.com/astral-sh/uv", tag = "0.9.5" }
uv-redacted = { git = "https://github.com/astral-sh/uv", tag = "0.9.5" }
uv-requirements = { git = "https://github.com/astral-sh/uv", tag = "0.9.5" }
uv-requirements-txt = { git = "https://github.com/astral-sh/uv", tag = "0.9.5" }
uv-resolver = { git = "https://github.com/astral-sh/uv", tag = "0.9.5" }
uv-types = { git = "https://github.com/astral-sh/uv", tag = "0.9.5" }
uv-workspace = { git = "https://github.com/astral-sh/uv", tag = "0.9.5" }
uv-build-frontend = { git = "https://github.com/astral-sh/uv", tag = "0.9.29" }
uv-cache = { git = "https://github.com/astral-sh/uv", tag = "0.9.29" }
uv-cache-info = { git = "https://github.com/astral-sh/uv", tag = "0.9.29" }
uv-cache-key = { git = "https://github.com/astral-sh/uv", tag = "0.9.29" }
uv-client = { git = "https://github.com/astral-sh/uv", tag = "0.9.29" }
uv-configuration = { git = "https://github.com/astral-sh/uv", tag = "0.9.29" }
uv-dispatch = { git = "https://github.com/astral-sh/uv", tag = "0.9.29" }
uv-distribution = { git = "https://github.com/astral-sh/uv", tag = "0.9.29" }
uv-distribution-filename = { git = "https://github.com/astral-sh/uv", tag = "0.9.29" }
uv-distribution-types = { git = "https://github.com/astral-sh/uv", tag = "0.9.29" }
uv-flags = { git = "https://github.com/astral-sh/uv", tag = "0.9.29" }
uv-git = { git = "https://github.com/astral-sh/uv", tag = "0.9.29" }
uv-git-types = { git = "https://github.com/astral-sh/uv", tag = "0.9.29" }
uv-install-wheel = { git = "https://github.com/astral-sh/uv", tag = "0.9.29" }
uv-installer = { git = "https://github.com/astral-sh/uv", tag = "0.9.29" }
uv-normalize = { git = "https://github.com/astral-sh/uv", tag = "0.9.29" }
uv-pep440 = { git = "https://github.com/astral-sh/uv", tag = "0.9.29" }
uv-pep508 = { git = "https://github.com/astral-sh/uv", tag = "0.9.29" }
uv-platform-tags = { git = "https://github.com/astral-sh/uv", tag = "0.9.29" }
uv-preview = { git = "https://github.com/astral-sh/uv", tag = "0.9.29" }
uv-pypi-types = { git = "https://github.com/astral-sh/uv", tag = "0.9.29" }
uv-python = { git = "https://github.com/astral-sh/uv", tag = "0.9.29" }
uv-redacted = { git = "https://github.com/astral-sh/uv", tag = "0.9.29" }
uv-requirements = { git = "https://github.com/astral-sh/uv", tag = "0.9.29" }
uv-requirements-txt = { git = "https://github.com/astral-sh/uv", tag = "0.9.29" }
uv-resolver = { git = "https://github.com/astral-sh/uv", tag = "0.9.29" }
uv-types = { git = "https://github.com/astral-sh/uv", tag = "0.9.29" }
uv-workspace = { git = "https://github.com/astral-sh/uv", tag = "0.9.29" }
which = "8.0.0"
xxhash-rust = "0.8.15"
zip = { version = "2.4.2", default-features = false }
Expand Down Expand Up @@ -250,9 +247,8 @@ simple_spawn_blocking = { version = "1.1.0", default-features = false }
rattler-build = { git = "https://github.com/prefix-dev/rattler-build", branch = "main", default-features = false }

[patch.crates-io]
# This is a temporary patch to get `cargo vendor` to work with the `uv` and pep508_rs` crates.
reqwest-middleware = { git = "https://github.com/astral-sh/reqwest-middleware", rev = "7650ed76215a962a96d94a79be71c27bffde7ab2" }
reqwest-retry = { git = "https://github.com/astral-sh/reqwest-middleware", rev = "7650ed76215a962a96d94a79be71c27bffde7ab2" }
reqwest-middleware = { path = "crates/reqwest-middleware-shim" }
reqwest-retry = { path = "crates/reqwest-retry-shim" }
version-ranges = { git = "https://github.com/astral-sh/pubgrub", rev = "d8efd77673c9a90792da9da31b6c0da7ea8a324b" }

[profile.ci]
Expand Down
3 changes: 0 additions & 3 deletions crates/pixi-build-backend/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,3 @@ recipe-stage0 = { workspace = true }
[dev-dependencies]
insta = { version = "1.42.1", features = ["yaml", "redactions", "filters"] }
toml = { version = "0.9.0" }

[package.metadata.cargo-shear]
ignored = ["async-trait"]
1 change: 0 additions & 1 deletion crates/pixi_cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,6 @@ tracing = { workspace = true }
tracing-subscriber = { workspace = true, features = ["env-filter"] }
typed-path = { workspace = true }
url = { workspace = true }
uv-client = { workspace = true }
uv-configuration = { workspace = true }
uv-distribution = { workspace = true }
uv-distribution-types = { workspace = true }
Expand Down
11 changes: 3 additions & 8 deletions crates/pixi_cli/src/import.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ use pixi_uv_conversions::convert_uv_requirements_to_pep508;
use rattler_conda_types::Platform;

use tracing::warn;
use uv_client::BaseClientBuilder;
use uv_requirements_txt::RequirementsTxt;

use miette::{Diagnostic, IntoDiagnostic, Result};
Expand Down Expand Up @@ -198,13 +197,9 @@ 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(),
&BaseClientBuilder::default(),
)
.await
.into_diagnostic()?;
let reqs_txt = RequirementsTxt::parse(&input_file, workspace.workspace().root())
.await
.into_diagnostic()?;
let pypi_deps = convert_uv_requirements_txt_to_pep508(reqs_txt)?;

(vec![], pypi_deps)
Expand Down
7 changes: 5 additions & 2 deletions crates/pixi_core/src/lock_file/install_subset.rs
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,11 @@ impl<'a> InstallSubset<'a> {
let all_packages: Vec<_> = packages.into_iter().collect();

// Check if any packages do not match
let mut non_matched_targets: HashSet<_> =
self.target_packages.iter().map(AsRef::as_ref).collect();
let mut non_matched_targets: HashSet<&str> = self
.target_packages
.iter()
.map(|name| name.as_str())
.collect();
for package in &all_packages {
if non_matched_targets.contains(package.name()) {
non_matched_targets.remove(package.name());
Expand Down
26 changes: 17 additions & 9 deletions crates/pixi_core/src/lock_file/resolve/build_dispatch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ use uv_build_frontend::SourceBuild;
use uv_cache::Cache;
use uv_client::RegistryClient;
use uv_configuration::{
BuildKind, BuildOptions, BuildOutput, Concurrency, Constraints, IndexStrategy, SourceStrategy,
BuildKind, BuildOptions, BuildOutput, Concurrency, Constraints, IndexStrategy, NoSources,
};
use uv_dispatch::{BuildDispatch, BuildDispatchError, SharedState};
use uv_distribution_filename::DistFilename;
Expand Down Expand Up @@ -70,7 +70,7 @@ pub struct UvBuildDispatchParams<'a> {
shared_state: SharedState,
link_mode: uv_install_wheel::LinkMode,
exclude_newer: Option<ExcludeNewer>,
sources: SourceStrategy,
sources: NoSources,
concurrency: Concurrency,
preview: uv_preview::Preview,
workspace_cache: WorkspaceCache,
Expand Down Expand Up @@ -105,7 +105,7 @@ impl<'a> UvBuildDispatchParams<'a> {
link_mode: LinkMode::default(),
constraints: Constraints::default(),
exclude_newer: None,
sources: SourceStrategy::default(),
sources: NoSources::default(),
concurrency: Concurrency::default(),
preview: uv_preview::Preview::default(),
workspace_cache: WorkspaceCache::default(),
Expand All @@ -125,7 +125,7 @@ impl<'a> UvBuildDispatchParams<'a> {
}

/// Set the source strategy for the build dispatch
pub fn with_source_strategy(mut self, sources: SourceStrategy) -> Self {
pub fn with_source_strategy(mut self, sources: NoSources) -> Self {
self.sources = sources;
self
}
Expand Down Expand Up @@ -420,7 +420,7 @@ impl<'a> LazyBuildDispatch<'a> {
self.params.build_options,
self.params.hasher,
self.params.exclude_newer.clone().unwrap_or_default(),
self.params.sources,
self.params.sources.clone(),
self.params.workspace_cache.clone(),
self.params.concurrency,
self.params.preview,
Expand Down Expand Up @@ -474,8 +474,8 @@ impl BuildContext for LazyBuildDispatch<'_> {
self.params.config_settings
}

fn sources(&self) -> uv_configuration::SourceStrategy {
self.params.sources
fn sources(&self) -> &NoSources {
&self.params.sources
}

fn locations(&self) -> &uv_distribution_types::IndexLocations {
Expand Down Expand Up @@ -514,7 +514,7 @@ impl BuildContext for LazyBuildDispatch<'_> {
install_path: &'a Path,
version_id: Option<&'a str>,
dist: Option<&'a SourceDist>,
sources: SourceStrategy,
sources: &'a NoSources,
build_kind: BuildKind,
build_output: BuildOutput,
build_stack: BuildStack,
Expand All @@ -541,12 +541,20 @@ impl BuildContext for LazyBuildDispatch<'_> {
source: &'a Path,
subdirectory: Option<&'a Path>,
output_dir: &'a Path,
sources: NoSources,
build_kind: BuildKind,
version_id: Option<&'a str>,
) -> Result<Option<DistFilename>, impl IsBuildBackendError> {
let dispatch = self.get_or_try_init().await?;
dispatch
.direct_build(source, subdirectory, output_dir, build_kind, version_id)
.direct_build(
source,
subdirectory,
output_dir,
sources,
build_kind,
version_id,
)
.await
.map_err(LazyBuildDispatchError::from)
}
Expand Down
9 changes: 5 additions & 4 deletions crates/pixi_core/src/lock_file/resolve/pypi.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use std::{
cell::RefCell,
collections::{HashMap, HashSet},
collections::{BTreeSet, HashMap, HashSet},
iter::once,
ops::Deref,
panic,
Expand Down Expand Up @@ -45,7 +45,7 @@ use typed_path::Utf8TypedPathBuf;
use url::Url;
use uv_cache_key::RepositoryUrl;
use uv_client::{Connectivity, FlatIndexClient, RegistryClient};
use uv_configuration::{Constraints, Overrides};
use uv_configuration::{Constraints, Excludes, Overrides};
use uv_distribution::DistributionDatabase;
use uv_distribution_types::{
BuiltDist, ConfigSettings, DependencyMetadata, Diagnostic, Dist, FileLocation, HashPolicy,
Expand Down Expand Up @@ -551,7 +551,7 @@ pub async fn resolve_pypi(
// mostly with build isolation. In that case we want to use fresh
// non-tampered requests.
.with_shared_state(context.shared_state.fork())
.with_source_strategy(context.source_strategy)
.with_source_strategy(context.source_strategy.clone())
.with_concurrency(context.concurrency);

let lazy_build_dispatch_dependencies = LazyBuildDispatchDependencies::default();
Expand Down Expand Up @@ -694,9 +694,10 @@ pub async fn resolve_pypi(
requirements,
constraints,
overrides,
Excludes::default(),
Preferences::from_iter(preferences, &resolver_env),
None,
Default::default(),
BTreeSet::new(),
uv_resolver::Exclusions::default(),
lookaheads,
);
Expand Down
1 change: 0 additions & 1 deletion crates/pixi_install_pypi/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ tokio = { workspace = true }
tracing = { workspace = true }
typed-path = { workspace = true }
url = { workspace = true }
uv-auth = { workspace = true }
uv-cache = { workspace = true }
uv-cache-info = { workspace = true }
uv-client = { workspace = true }
Expand Down
8 changes: 5 additions & 3 deletions crates/pixi_install_pypi/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ use rattler_conda_types::Platform;
use rattler_lock::{PypiIndexes, PypiPackageData, PypiPackageEnvironmentData};
use rayon::prelude::*;
use utils::elapsed;
use uv_auth::store_credentials_from_url;
use uv_client::{Connectivity, FlatIndexClient, RegistryClient};
use uv_configuration::{BuildOptions, Constraints, IndexStrategy};
use uv_dispatch::BuildDispatch;
Expand Down Expand Up @@ -769,7 +768,10 @@ impl<'a> PyPIEnvironmentUpdater<'a> {
// Before hitting the network let's make sure the credentials are available to
// uv
for url in setup.index_locations.indexes().map(|index| index.url()) {
let success = store_credentials_from_url(url.url());
let success = setup
.registry_client
.credentials_cache()
.store_credentials_from_url(url.url());
tracing::debug!("Stored credentials for {}: {}", url, success);
}

Expand Down Expand Up @@ -833,7 +835,7 @@ impl<'a> PyPIEnvironmentUpdater<'a> {
&setup.build_options,
&self.context_config.uv_context.hash_strategy,
setup.exclude_newer.clone(),
self.context_config.uv_context.source_strategy,
self.context_config.uv_context.source_strategy.clone(),
self.context_config.uv_context.workspace_cache.clone(),
self.context_config.uv_context.concurrency,
self.context_config.uv_context.preview,
Expand Down
1 change: 1 addition & 0 deletions crates/pixi_install_pypi/src/plan/test/harness.rs
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ impl InstalledDistBuilder {
.reference()
.as_str()
.map(ToString::to_string),
git_lfs: None,
},
};

Expand Down
6 changes: 3 additions & 3 deletions crates/pixi_uv_context/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use uv_cache::Cache;
use uv_client::{
BaseClientBuilder, Connectivity, ExtraMiddleware, RegistryClient, RegistryClientBuilder,
};
use uv_configuration::{Concurrency, IndexStrategy, SourceStrategy, TrustedHost};
use uv_configuration::{Concurrency, IndexStrategy, NoSources, TrustedHost};
use uv_dispatch::SharedState;
use uv_distribution_types::{
ExtraBuildRequires, ExtraBuildVariables, IndexCapabilities, IndexLocations,
Expand All @@ -32,7 +32,7 @@ pub struct UvResolutionContext {
pub hash_strategy: HashStrategy,
pub keyring_provider: uv_configuration::KeyringProviderType,
pub concurrency: Concurrency,
pub source_strategy: SourceStrategy,
pub source_strategy: NoSources,
pub capabilities: IndexCapabilities,
pub allow_insecure_host: Vec<TrustedHost>,
pub shared_state: SharedState,
Expand Down Expand Up @@ -92,7 +92,7 @@ impl UvResolutionContext {
hash_strategy: HashStrategy::None,
keyring_provider,
concurrency: Concurrency::default(),
source_strategy: SourceStrategy::Enabled,
source_strategy: NoSources::default(),
capabilities: IndexCapabilities::default(),
allow_insecure_host,
shared_state: SharedState::default(),
Expand Down
1 change: 1 addition & 0 deletions crates/pixi_uv_conversions/src/conversions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,7 @@ pub fn to_parsed_git_url(
},
into_uv_git_reference(git_source.reference.into()),
Some(into_uv_git_sha(git_source.commit)),
uv_git_types::GitLfs::from_env(),
)
.into_diagnostic()?,
if git_source.subdirectory.is_empty() {
Expand Down
4 changes: 2 additions & 2 deletions crates/pixi_uv_conversions/src/git_url.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use std::str::FromStr;
use url::Url;
use uv_pep508::VerbatimUrl;
use uv_redacted::DisplaySafeUrl;
use uv_redacted::{DisplaySafeUrl, DisplaySafeUrlError};

/// A URL that may have a git+ prefix, with methods to handle both representations
#[derive(Debug, Clone, PartialEq)]
Expand Down Expand Up @@ -70,7 +70,7 @@ impl GitUrlWithPrefix {
}

/// Convert to VerbatimUrl (preserving git+ prefix)
pub fn to_verbatim_url(&self) -> Result<VerbatimUrl, url::ParseError> {
pub fn to_verbatim_url(&self) -> Result<VerbatimUrl, DisplaySafeUrlError> {
let display_safe_url = DisplaySafeUrl::parse(&self.with_git_prefix())?;
Ok(VerbatimUrl::from_url(display_safe_url))
}
Expand Down
Loading
Loading