Skip to content

Commit

Permalink
chore: bump uv and rattler to the latest versions (prefix-dev#2652)
Browse files Browse the repository at this point in the history
Co-authored-by: Tim de Jager <[email protected]>
  • Loading branch information
ruben-arts and tdejager authored Dec 5, 2024
1 parent 2a1e115 commit 1795629
Show file tree
Hide file tree
Showing 8 changed files with 956 additions and 699 deletions.
1,498 changes: 870 additions & 628 deletions Cargo.lock

Large diffs are not rendered by default.

93 changes: 45 additions & 48 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ fs-err = { version = "2.11.0" }
fs_extra = "1.3.0"
futures = "0.3.30"
http = "1.1.0"
http-cache-reqwest = "0.14.0"
http-cache-reqwest = "0.15.0"
human_bytes = "0.4.3"
humantime = "2.1.0"
ignore = "0.4.22"
Expand All @@ -65,8 +65,8 @@ percent-encoding = "2.3.1"
pyproject-toml = "0.13.4"
regex = "1.10.4"
reqwest = { version = "0.12.9", default-features = false }
reqwest-middleware = "0.3.0"
reqwest-retry = "0.5.0"
reqwest-middleware = "0.4"
reqwest-retry = "0.7.0"
rlimit = "0.10.1"
rstest = "0.19.0"
self-replace = "1.3.7"
Expand All @@ -84,7 +84,7 @@ spdx = "0.10.4"
strsim = "0.11.1"
tabwriter = "1.4.0"
tar = "0.4.40"
tempfile = "3.10.1"
tempfile = "3.14.0"
thiserror = "1.0.58"
tokio = "1.37.0"
tokio-stream = "0.1.16"
Expand All @@ -93,48 +93,48 @@ toml_edit = "0.22.11"
tracing = "0.1.40"
tracing-subscriber = "0.3.18"
typed-path = "0.9.2"
uv-distribution-filename = { git = "https://github.com/astral-sh/uv", tag = "0.4.30" }
uv-distribution-types = { git = "https://github.com/astral-sh/uv", tag = "0.4.30" }
uv-install-wheel = { git = "https://github.com/astral-sh/uv", tag = "0.4.30" }
uv-pep440 = { git = "https://github.com/astral-sh/uv", tag = "0.4.30" }
uv-pep508 = { git = "https://github.com/astral-sh/uv", tag = "0.4.30" }
uv-platform-tags = { git = "https://github.com/astral-sh/uv", tag = "0.4.30" }
uv-pypi-types = { git = "https://github.com/astral-sh/uv", tag = "0.4.30" }
uv-distribution-filename = { git = "https://github.com/astral-sh/uv", tag = "0.5.6" }
uv-distribution-types = { git = "https://github.com/astral-sh/uv", tag = "0.5.6" }
uv-install-wheel = { git = "https://github.com/astral-sh/uv", tag = "0.5.6" }
uv-pep440 = { git = "https://github.com/astral-sh/uv", tag = "0.5.6" }
uv-pep508 = { git = "https://github.com/astral-sh/uv", tag = "0.5.6" }
uv-platform-tags = { git = "https://github.com/astral-sh/uv", tag = "0.5.6" }
uv-pypi-types = { git = "https://github.com/astral-sh/uv", tag = "0.5.6" }
uv-requirements-txt = { git = "https://github.com/astral-sh/uv", tag = "0.4.30" }
wax = "0.6.0"
which = "6.0.3"

# Rattler crates
file_url = "0.1.4"
rattler = { version = "0.28.1", default-features = false }
rattler_cache = { version = "0.2.9", default-features = false }
rattler_conda_types = { version = "0.29.1", default-features = false }
file_url = "0.2.0"
rattler = { version = "0.28.5", default-features = false }
rattler_cache = { version = "0.2.13", default-features = false }
rattler_conda_types = { version = "0.29.3", default-features = false }
rattler_digest = { version = "1.0.3", default-features = false }
rattler_lock = { version = "0.22.30", default-features = false }
rattler_networking = { version = "0.21.5", default-features = false, features = [
rattler_lock = { version = "0.22.32", default-features = false }
rattler_networking = { version = "0.21.8", default-features = false, features = [
"google-cloud-auth",
] }
rattler_repodata_gateway = { version = "0.21.21", default-features = false }
rattler_shell = { version = "0.22.6", default-features = false }
rattler_solve = { version = "1.2.2", default-features = false }
rattler_virtual_packages = { version = "1.1.9", default-features = false }
rattler_repodata_gateway = { version = "0.21.25", default-features = false }
rattler_shell = { version = "0.22.8", default-features = false }
rattler_solve = { version = "1.2.4", default-features = false }
rattler_virtual_packages = { version = "1.1.11", default-features = false }


# Bumping this to a higher version breaks the Windows path handling.
url = "2.5.2"
uv-auth = { git = "https://github.com/astral-sh/uv", tag = "0.4.30" }
uv-cache = { git = "https://github.com/astral-sh/uv", tag = "0.4.30" }
uv-client = { git = "https://github.com/astral-sh/uv", tag = "0.4.30" }
uv-configuration = { git = "https://github.com/astral-sh/uv", tag = "0.4.30" }
uv-dispatch = { git = "https://github.com/astral-sh/uv", tag = "0.4.30" }
uv-distribution = { git = "https://github.com/astral-sh/uv", tag = "0.4.30" }
uv-git = { git = "https://github.com/astral-sh/uv", tag = "0.4.30" }
uv-installer = { git = "https://github.com/astral-sh/uv", tag = "0.4.30" }
uv-normalize = { git = "https://github.com/astral-sh/uv", tag = "0.4.30" }
uv-python = { git = "https://github.com/astral-sh/uv", tag = "0.4.30" }
uv-requirements = { git = "https://github.com/astral-sh/uv", tag = "0.4.30" }
uv-resolver = { git = "https://github.com/astral-sh/uv", tag = "0.4.30" }
uv-types = { git = "https://github.com/astral-sh/uv", tag = "0.4.30" }
uv-auth = { git = "https://github.com/astral-sh/uv", tag = "0.5.6" }
uv-cache = { git = "https://github.com/astral-sh/uv", tag = "0.5.6" }
uv-client = { git = "https://github.com/astral-sh/uv", tag = "0.5.6" }
uv-configuration = { git = "https://github.com/astral-sh/uv", tag = "0.5.6" }
uv-dispatch = { git = "https://github.com/astral-sh/uv", tag = "0.5.6" }
uv-distribution = { git = "https://github.com/astral-sh/uv", tag = "0.5.6" }
uv-git = { git = "https://github.com/astral-sh/uv", tag = "0.5.6" }
uv-installer = { git = "https://github.com/astral-sh/uv", tag = "0.5.6" }
uv-normalize = { git = "https://github.com/astral-sh/uv", tag = "0.5.6" }
uv-python = { git = "https://github.com/astral-sh/uv", tag = "0.5.6" }
uv-requirements = { git = "https://github.com/astral-sh/uv", tag = "0.5.6" }
uv-resolver = { git = "https://github.com/astral-sh/uv", tag = "0.5.6" }
uv-types = { git = "https://github.com/astral-sh/uv", tag = "0.5.6" }
winapi = { version = "0.3.9", default-features = false }
xxhash-rust = "0.8.10"
zip = { version = "2.2.0", default-features = false }
Expand Down Expand Up @@ -347,20 +347,17 @@ tokio = { workspace = true, features = ["rt"] }


[patch.crates-io]
reqwest-middleware = { git = "https://github.com/TrueLayer/reqwest-middleware", rev = "d95ec5a99fcc9a4339e1850d40378bbfe55ab121" }
reqwest-retry = { git = "https://github.com/TrueLayer/reqwest-middleware", rev = "d95ec5a99fcc9a4339e1850d40378bbfe55ab121" }

file_url = { git = "https://github.com/conda/rattler", branch = "main" }
rattler = { git = "https://github.com/conda/rattler", branch = "main" }
rattler_conda_types = { git = "https://github.com/conda/rattler", branch = "main" }
rattler_digest = { git = "https://github.com/conda/rattler", branch = "main" }
rattler_lock = { git = "https://github.com/conda/rattler", branch = "main" }
rattler_networking = { git = "https://github.com/conda/rattler", branch = "main" }
rattler_package_streaming = { git = "https://github.com/conda/rattler", branch = "main" }
rattler_repodata_gateway = { git = "https://github.com/conda/rattler", branch = "main" }
rattler_shell = { git = "https://github.com/conda/rattler", branch = "main" }
rattler_solve = { git = "https://github.com/conda/rattler", branch = "main" }
rattler_virtual_packages = { git = "https://github.com/conda/rattler", branch = "main" }
#file_url = { git = "https://github.com/conda/rattler", branch = "main" }
#rattler = { git = "https://github.com/conda/rattler", branch = "main" }
#rattler_conda_types = { git = "https://github.com/conda/rattler", branch = "main" }
#rattler_digest = { git = "https://github.com/conda/rattler", branch = "main" }
#rattler_lock = { git = "https://github.com/conda/rattler", branch = "main" }
#rattler_networking = { git = "https://github.com/conda/rattler", branch = "main" }
#rattler_package_streaming = { git = "https://github.com/conda/rattler", branch = "main" }
#rattler_repodata_gateway = { git = "https://github.com/conda/rattler", branch = "main" }
#rattler_shell = { git = "https://github.com/conda/rattler", branch = "main" }
#rattler_solve = { git = "https://github.com/conda/rattler", branch = "main" }
#rattler_virtual_packages = { git = "https://github.com/conda/rattler", branch = "main" }

# Config for 'dist'
[workspace.metadata.dist]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
source: crates/pixi_manifest/src/pypi/pypi_requirement.rs
expression: snapshot
snapshot_kind: text
---
- input:
ver: 1.2.3
Expand Down Expand Up @@ -43,7 +44,7 @@ expression: snapshot
- input:
git: "ssh://github.com:conda-forge/21cmfast-feedstock"
result:
error: "ERROR: invalid value: string \"ssh://github.com:conda-forge/21cmfast-feedstock\", expected invalid port number"
error: "ERROR: invalid port number: \"ssh://github.com:conda-forge/21cmfast-feedstock\""
- input:
branch: main
tag: v1
Expand Down
2 changes: 2 additions & 0 deletions crates/pixi_uv_conversions/src/requirements.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ pub fn as_uv_req(
RequirementSource::Registry {
specifier: to_version_specificers(version)?,
index: index.clone(),
conflict: None,
}
}
PyPiRequirement::Git {
Expand Down Expand Up @@ -176,6 +177,7 @@ pub fn as_uv_req(
PyPiRequirement::RawVersion(version) => RequirementSource::Registry {
specifier: to_version_specificers(version)?,
index: None,
conflict: None,
},
};

Expand Down
15 changes: 10 additions & 5 deletions src/install_pypi/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ use utils::elapsed;
use uv_auth::store_credentials_from_url;
use uv_client::{Connectivity, FlatIndexClient, RegistryClientBuilder};
use uv_configuration::{ConfigSettings, Constraints, IndexStrategy, LowerBound};
use uv_dispatch::BuildDispatch;
use uv_dispatch::{BuildDispatch, SharedState};
use uv_distribution::{DistributionDatabase, RegistryWheelIndex};
use uv_distribution_types::{DependencyMetadata, IndexLocations, Name};
use uv_git::GitResolver;
Expand Down Expand Up @@ -122,6 +122,14 @@ pub async fn update_python_distributions(

let dep_metadata = DependencyMetadata::default();
let constraints = Constraints::default();

let shared_state = SharedState::new(
git_resolver,
in_memory_index,
uv_context.in_flight.clone(),
uv_context.capabilities.clone(),
);

let build_dispatch = BuildDispatch::new(
&registry_client,
&uv_context.cache,
Expand All @@ -130,10 +138,7 @@ pub async fn update_python_distributions(
&index_locations,
&flat_index,
&dep_metadata,
&in_memory_index,
&git_resolver,
&uv_context.capabilities,
&uv_context.in_flight,
shared_state,
IndexStrategy::default(),
&config_settings,
build_isolation,
Expand Down
31 changes: 22 additions & 9 deletions src/lock_file/resolve/pypi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,15 @@ use typed_path::Utf8TypedPathBuf;
use url::Url;
use uv_client::{Connectivity, FlatIndexClient, RegistryClient, RegistryClientBuilder};
use uv_configuration::{ConfigSettings, Constraints, IndexStrategy, LowerBound, Overrides};
use uv_dispatch::BuildDispatch;
use uv_dispatch::{BuildDispatch, SharedState};
use uv_distribution::DistributionDatabase;
use uv_distribution_types::{
BuiltDist, DependencyMetadata, Diagnostic, Dist, FileLocation, HashPolicy, IndexCapabilities,
IndexUrl, InstalledDist, InstalledRegistryDist, Name, Resolution, ResolvedDist, SourceDist,
};
use uv_git::GitResolver;
use uv_install_wheel::linker::LinkMode;
use uv_pypi_types::{HashAlgorithm, HashDigest, RequirementSource};
use uv_pypi_types::{Conflicts, HashAlgorithm, HashDigest, RequirementSource};
use uv_python::{Interpreter, PythonEnvironment};
use uv_requirements::LookaheadResolver;
use uv_resolver::{
Expand Down Expand Up @@ -337,6 +337,14 @@ pub async fn resolve_pypi(
..Options::default()
};
let git_resolver = GitResolver::default();

let shared_state = SharedState::new(
git_resolver.clone(),
build_dispatch_in_memory_index,
context.in_flight.clone(),
context.capabilities.clone(),
);

let build_dispatch = BuildDispatch::new(
&registry_client,
&context.cache,
Expand All @@ -346,10 +354,7 @@ pub async fn resolve_pypi(
&flat_index,
&dependency_metadata,
// TODO: could use this later to add static metadata
&build_dispatch_in_memory_index,
&git_resolver,
&context.capabilities,
&context.in_flight,
shared_state,
IndexStrategy::default(),
&config_settings,
build_isolation,
Expand Down Expand Up @@ -377,6 +382,7 @@ pub async fn resolve_pypi(
let source = RequirementSource::Registry {
specifier: specifier.into(),
index: None,
conflict: None,
};

Ok::<_, ConversionError>(uv_pypi_types::Requirement {
Expand Down Expand Up @@ -479,6 +485,7 @@ pub async fn resolve_pypi(
&context.hash_strategy,
resolver_env,
&PythonRequirement::from_marker_environment(&marker_environment, requires_python.clone()),
Conflicts::default(),
&resolver_in_memory_index,
&git_resolver,
&context.capabilities,
Expand Down Expand Up @@ -647,11 +654,14 @@ async fn lock_pypi_packages<'a>(

let pypi_package_data = match dist {
// Ignore installed distributions
ResolvedDist::Installed(_) => {
ResolvedDist::Installed { .. } => {
continue;
}

ResolvedDist::Installable(Dist::Built(dist)) => {
ResolvedDist::Installable {
dist: Dist::Built(dist),
..
} => {
let (location, hash) = match &dist {
BuiltDist::Registry(dist) => {
let best_wheel = dist.best_wheel();
Expand Down Expand Up @@ -710,7 +720,10 @@ async fn lock_pypi_packages<'a>(
hash,
}
}
ResolvedDist::Installable(Dist::Source(source)) => {
ResolvedDist::Installable {
dist: Dist::Source(source),
..
} => {
// Handle new hash stuff
let hash = source
.file()
Expand Down
7 changes: 2 additions & 5 deletions src/lock_file/resolve/uv_resolution_context.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
use std::sync::Arc;

use miette::{Context, IntoDiagnostic};
use uv_cache::Cache;
use uv_configuration::{BuildOptions, Concurrency, SourceStrategy, TrustedHost};
Expand All @@ -15,7 +13,7 @@ use pixi_uv_conversions::{to_uv_trusted_host, ConversionError};
#[derive(Clone)]
pub struct UvResolutionContext {
pub cache: Cache,
pub in_flight: Arc<InFlight>,
pub in_flight: InFlight,
pub build_options: BuildOptions,
pub hash_strategy: HashStrategy,
pub client: reqwest::Client,
Expand Down Expand Up @@ -48,7 +46,6 @@ impl UvResolutionContext {
}
};

let in_flight = Arc::new(InFlight::default());
let allow_insecure_host = project
.config()
.pypi_config
Expand All @@ -66,7 +63,7 @@ impl UvResolutionContext {
.context("failed to parse trusted host")?;
Ok(Self {
cache,
in_flight,
in_flight: InFlight::default(),
hash_strategy: HashStrategy::None,
client: project.client().clone(),
build_options: BuildOptions::default(),
Expand Down
6 changes: 3 additions & 3 deletions tests/integration_python/test_main_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,17 +155,17 @@ def test_project_commands(pixi: Path, tmp_pixi_workspace: Path) -> None:
verify_cli_command(
[pixi, "project", "--manifest-path", manifest_path, "version", "major"],
ExitCode.SUCCESS,
stderr_contains="2.2.3",
stderr_contains="2.0.0",
)
verify_cli_command(
[pixi, "project", "--manifest-path", manifest_path, "version", "minor"],
ExitCode.SUCCESS,
stderr_contains="2.3.3",
stderr_contains="2.1.0",
)
verify_cli_command(
[pixi, "project", "--manifest-path", manifest_path, "version", "patch"],
ExitCode.SUCCESS,
stderr_contains="2.3.4",
stderr_contains="2.1.1",
)


Expand Down

0 comments on commit 1795629

Please sign in to comment.