diff --git a/crates/uv-resolver/src/error.rs b/crates/uv-resolver/src/error.rs index b237eba0adbb..c32e247f9ad8 100644 --- a/crates/uv-resolver/src/error.rs +++ b/crates/uv-resolver/src/error.rs @@ -37,18 +37,6 @@ pub enum ResolveError { #[error("Attempted to wait on an unregistered task")] Unregistered, - #[error("Attempted to wait on an unregistered task 1 ")] - Unregistered1, - - #[error("Attempted to wait on an unregistered task 2 ")] - Unregistered2, - - #[error("Attempted to wait on an unregistered task 3 ")] - Unregistered3, - - #[error("Attempted to wait on an unregistered task 4 ")] - Unregistered4, - #[error("Package metadata name `{metadata}` does not match given name `{given}`")] NameMismatch { given: PackageName, diff --git a/crates/uv-resolver/src/resolver/mod.rs b/crates/uv-resolver/src/resolver/mod.rs index 8abe1a60546b..1c97734836f0 100644 --- a/crates/uv-resolver/src/resolver/mod.rs +++ b/crates/uv-resolver/src/resolver/mod.rs @@ -550,7 +550,7 @@ impl<'a, Provider: ResolverProvider> Resolver<'a, Provider> { /// partial solution. /// /// Returns [None] when there are no versions in the given range. - #[instrument(skip_all, fields(% package))] + #[instrument(skip_all, fields(%package))] async fn choose_version( &self, package: &PubGrubPackage, @@ -614,7 +614,7 @@ impl<'a, Provider: ResolverProvider> Resolver<'a, Provider> { .distributions .wait(&dist.package_id()) .await - .ok_or(ResolveError::Unregistered4)?; + .ok_or(ResolveError::Unregistered)?; let version = &metadata.version; if range.contains(version) { Ok(Some(ResolverVersion::Available(version.clone()))) @@ -642,7 +642,7 @@ impl<'a, Provider: ResolverProvider> Resolver<'a, Provider> { .wait(package_name) .instrument(info_span!("package_wait", %package_name)) .await - .ok_or(ResolveError::Unregistered3)?; + .ok_or(ResolveError::Unregistered)?; self.visited.insert(package_name.clone()); let version_map = match *versions_response { @@ -761,7 +761,7 @@ impl<'a, Provider: ResolverProvider> Resolver<'a, Provider> { } /// Given a candidate package and version, return its dependencies. - #[instrument(skip_all, fields(% package, % version))] + #[instrument(skip_all, fields(%package, %version))] async fn get_dependencies( &self, package: &PubGrubPackage, @@ -883,7 +883,7 @@ impl<'a, Provider: ResolverProvider> Resolver<'a, Provider> { .wait(&package_id) .instrument(info_span!("distributions_wait", %package_id)) .await - .ok_or(ResolveError::Unregistered2)?; + .ok_or(ResolveError::Unregistered)?; let mut constraints = PubGrubDependencies::from_requirements( &metadata.requires_dist, @@ -969,7 +969,7 @@ impl<'a, Provider: ResolverProvider> Resolver<'a, Provider> { Ok::<(), ResolveError>(()) } - #[instrument(skip_all, fields(% request))] + #[instrument(skip_all, fields(%request))] async fn process_request(&self, request: Request) -> Result, ResolveError> { match request { // Fetch package metadata from the registry. @@ -1023,7 +1023,7 @@ impl<'a, Provider: ResolverProvider> Resolver<'a, Provider> { .packages .wait(&package_name) .await - .ok_or(ResolveError::Unregistered1)?; + .ok_or(ResolveError::Unregistered)?; let version_map = match *versions_response { VersionsResponse::Found(ref version_map) => version_map, diff --git a/crates/uv/tests/pip_compile.rs b/crates/uv/tests/pip_compile.rs index 5fd10af4fef4..ee496ea420f2 100644 --- a/crates/uv/tests/pip_compile.rs +++ b/crates/uv/tests/pip_compile.rs @@ -2075,7 +2075,7 @@ fn compile_editable() -> Result<()> { requirements_in.write_str(indoc! {r" -e ../../scripts/editable-installs/poetry_editable -e ${PROJECT_ROOT}/../../scripts/editable-installs/maturin_editable - -e file://../../scripts/editable-installs/black_editable[d] + -e file://../../scripts/editable-installs/black_editable[dev] boltons # normal dependency for comparison " })?; @@ -2122,12 +2122,14 @@ fn compile_editable() -> Result<()> { # yarl numpy==1.26.2 # via poetry-editable + uvloop==0.19.0 + # via black yarl==1.9.2 # via aiohttp ----- stderr ----- Built 3 editables in [TIME] - Resolved 12 packages in [TIME] + Resolved 13 packages in [TIME] "###); Ok(()) diff --git a/scripts/editable-installs/black_editable/pyproject.toml b/scripts/editable-installs/black_editable/pyproject.toml index 1415b2dca02a..4f8bd991b624 100644 --- a/scripts/editable-installs/black_editable/pyproject.toml +++ b/scripts/editable-installs/black_editable/pyproject.toml @@ -20,6 +20,10 @@ jupyter = [ "ipython>=7.8.0", "tokenize-rt>=3.2.0", ] +dev = [ + "black[d]", + "black[uvloop]", +] [build-system] requires = ["flit_core>=3.4,<4"]