Skip to content

Commit

Permalink
Reverts
Browse files Browse the repository at this point in the history
  • Loading branch information
charliermarsh committed Feb 16, 2024
1 parent bd998d8 commit 173fd21
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 21 deletions.
12 changes: 0 additions & 12 deletions crates/uv-resolver/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
14 changes: 7 additions & 7 deletions crates/uv-resolver/src/resolver/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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())))
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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<Option<Response>, ResolveError> {
match request {
// Fetch package metadata from the registry.
Expand Down Expand Up @@ -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,
Expand Down
6 changes: 4 additions & 2 deletions crates/uv/tests/pip_compile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
"
})?;
Expand Down Expand Up @@ -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(())
Expand Down
4 changes: 4 additions & 0 deletions scripts/editable-installs/black_editable/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand Down

0 comments on commit 173fd21

Please sign in to comment.