diff --git a/Cargo.lock b/Cargo.lock index a567dbf00..7bb4c2782 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -213,17 +213,6 @@ dependencies = [ "tokio", ] -[[package]] -name = "async-recursion" -version = "1.0.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5fd55a5ba1179988837d24ab4c7cc8ed6efdeff578ede0416b4225a5fca35bd0" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.52", -] - [[package]] name = "async-trait" version = "0.1.78" @@ -2963,7 +2952,6 @@ version = "0.0.1" dependencies = [ "anyhow", "assert_fs", - "async-recursion", "fs-err", "indoc", "insta", diff --git a/Cargo.toml b/Cargo.toml index c7126b7c9..a14ae840a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -9,7 +9,7 @@ resolver = "2" [workspace.package] edition = "2021" -rust-version = "1.76" +rust-version = "1.77" homepage = "https://pypi.org/project/uv/" documentation = "https://pypi.org/project/uv/" repository = "https://github.com/astral-sh/uv" @@ -53,7 +53,6 @@ anstream = { version = "0.6.13" } anyhow = { version = "1.0.80" } async-channel = { version = "2.2.0" } async-compression = { version = "0.4.6" } -async-recursion = { version = "1.0.5" } async-trait = { version = "0.1.78" } async_http_range_reader = { version = "0.7.0" } async_zip = { git = "https://github.com/charliermarsh/rs-async-zip", rev = "d76801da0943de985254fc6255c0e476b57c5836", features = ["deflate"] } diff --git a/crates/requirements-txt/Cargo.toml b/crates/requirements-txt/Cargo.toml index 47eb4ae37..17c7525b6 100644 --- a/crates/requirements-txt/Cargo.toml +++ b/crates/requirements-txt/Cargo.toml @@ -20,7 +20,6 @@ uv-normalize = { workspace = true } uv-types = { workspace = true } uv-warnings = { workspace = true } -async-recursion = { workspace = true } fs-err = { workspace = true } regex = { workspace = true } reqwest = { workspace = true, optional = true } diff --git a/crates/requirements-txt/src/lib.rs b/crates/requirements-txt/src/lib.rs index df509a111..47968a3e3 100644 --- a/crates/requirements-txt/src/lib.rs +++ b/crates/requirements-txt/src/lib.rs @@ -40,7 +40,6 @@ use std::io; use std::path::{Path, PathBuf}; use std::str::FromStr; -use async_recursion::async_recursion; use serde::{Deserialize, Serialize}; use tracing::instrument; use unscanny::{Pattern, Scanner}; @@ -413,12 +412,11 @@ impl RequirementsTxt { /// the current working directory. However, relative paths to sub-files (e.g., `-r ../requirements.txt`) /// are resolved against the directory of the containing `requirements.txt` file, to match /// `pip`'s behavior. - #[async_recursion] pub async fn parse_inner( content: &str, working_dir: &Path, requirements_dir: &Path, - client_builder: &BaseClientBuilder<'async_recursion>, + client_builder: &BaseClientBuilder<'_>, ) -> Result { let mut s = Scanner::new(content); @@ -437,13 +435,14 @@ impl RequirementsTxt { } else { requirements_dir.join(filename.as_ref()) }; - let sub_requirements = Self::parse(&sub_file, working_dir, client_builder) - .await - .map_err(|err| RequirementsTxtParserError::Subfile { - source: Box::new(err), - start, - end, - })?; + let sub_requirements = + Box::pin(Self::parse(&sub_file, working_dir, client_builder)) + .await + .map_err(|err| RequirementsTxtParserError::Subfile { + source: Box::new(err), + start, + end, + })?; // Disallow conflicting `--index-url` in nested `requirements` files. if sub_requirements.index_url.is_some() @@ -475,13 +474,15 @@ impl RequirementsTxt { } else { requirements_dir.join(filename.as_ref()) }; - let sub_constraints = Self::parse(&sub_file, working_dir, client_builder) - .await - .map_err(|err| RequirementsTxtParserError::Subfile { - source: Box::new(err), - start, - end, - })?; + let sub_constraints = + Box::pin(Self::parse(&sub_file, working_dir, client_builder)) + .await + .map_err(|err| RequirementsTxtParserError::Subfile { + source: Box::new(err), + start, + end, + })?; + // Treat any nested requirements or constraints as constraints. This differs // from `pip`, which seems to treat `-r` requirements in constraints files as // _requirements_, but we don't want to support that. diff --git a/crates/uv-resolver/src/finder.rs b/crates/uv-resolver/src/finder.rs index b0a428af0..253349cd9 100644 --- a/crates/uv-resolver/src/finder.rs +++ b/crates/uv-resolver/src/finder.rs @@ -163,9 +163,7 @@ impl<'a> DistFinder<'a> { resolvable_dist .compatible_wheel() .map(|(dist, tag_priority)| (dist.clone(), tag_priority)), - resolvable_dist - .compatible_source() - .map(std::clone::Clone::clone), + resolvable_dist.compatible_source().cloned(), ) } else { (None, None, None) diff --git a/rust-toolchain.toml b/rust-toolchain.toml index 83a52c383..fcc85b9ec 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,2 +1,2 @@ [toolchain] -channel = "1.76" +channel = "1.77"