Remove unnecessary wrapping

This commit is contained in:
konstin 2025-05-08 15:06:07 +02:00
parent f99fc82b4a
commit c309d3351c
48 changed files with 64 additions and 63 deletions

View file

@ -175,7 +175,7 @@ type FindPythonResult = Result<PythonInstallation, PythonNotFound>;
/// The result of failed Python installation discovery.
///
/// See [`FindPythonResult`].
#[derive(Clone, Debug, Error)]
#[derive(Clone, Debug, Error, traversable_error::TraversableError)]
pub struct PythonNotFound {
pub request: PythonRequest,
pub python_preference: PythonPreference,
@ -209,7 +209,7 @@ pub enum PythonSource {
ParentInterpreter,
}
#[derive(Error, Debug)]
#[derive(Error, traversable_error::TraversableError, Debug)]
pub enum Error {
#[error(transparent)]
Io(#[from] io::Error),

View file

@ -33,13 +33,13 @@ struct PythonEnvironmentShared {
/// The result of failed environment discovery.
///
/// Generally this is cast from [`PythonNotFound`] by [`PythonEnvironment::find`].
#[derive(Clone, Debug, Error)]
#[derive(Clone, Debug, Error, traversable_error::TraversableError)]
pub struct EnvironmentNotFound {
request: PythonRequest,
preference: EnvironmentPreference,
}
#[derive(Clone, Debug, Error)]
#[derive(Clone, Debug, Error, traversable_error::TraversableError)]
pub struct InvalidEnvironment {
path: PathBuf,
pub kind: InvalidEnvironmentKind,

View file

@ -4,7 +4,7 @@ use std::{
};
use thiserror::Error;
#[derive(Error, Debug)]
#[derive(Error, traversable_error::TraversableError, Debug)]
pub enum Error {
#[error("Unknown Python implementation `{0}`")]
UnknownImplementation(String),

View file

@ -253,7 +253,7 @@ impl PythonInstallation {
}
}
#[derive(Error, Debug)]
#[derive(Error, traversable_error::TraversableError, Debug)]
pub enum PythonInstallationKeyError {
#[error("Failed to parse Python installation key `{0}`: {1}")]
ParseError(String, String),

View file

@ -598,7 +598,7 @@ impl ExternallyManaged {
}
}
#[derive(Debug, Error)]
#[derive(Debug, Error, traversable_error::TraversableError)]
pub struct UnexpectedResponseError {
#[source]
pub(super) err: serde_json::Error,
@ -636,7 +636,7 @@ impl Display for UnexpectedResponseError {
}
}
#[derive(Debug, Error)]
#[derive(Debug, Error, traversable_error::TraversableError)]
pub struct StatusCodeError {
pub(super) code: ExitStatus,
pub(super) stdout: String,
@ -673,7 +673,7 @@ impl Display for StatusCodeError {
}
}
#[derive(Debug, Error)]
#[derive(Debug, Error, traversable_error::TraversableError)]
pub enum Error {
#[error("Failed to query Python interpreter")]
Io(#[from] io::Error),
@ -701,7 +701,7 @@ pub enum Error {
Encode(#[from] rmp_serde::encode::Error),
}
#[derive(Debug, Error)]
#[derive(Debug, Error, traversable_error::TraversableError)]
pub struct BrokenSymlink {
pub path: PathBuf,
/// Whether the interpreter path looks like a virtual environment.
@ -735,7 +735,7 @@ enum InterpreterInfoResult {
Success(Box<InterpreterInfo>),
}
#[derive(Debug, Error, Deserialize, Serialize)]
#[derive(Debug, Error, traversable_error::TraversableError, Deserialize, Serialize)]
#[serde(tag = "kind", rename_all = "snake_case")]
pub enum InterpreterInfoError {
#[error("Could not detect a glibc or a musl libc (while running on Linux)")]

View file

@ -63,7 +63,7 @@ pub(crate) fn current_dir() -> Result<std::path::PathBuf, std::io::Error> {
.unwrap_or(std::env::current_dir())
}
#[derive(Debug, Error)]
#[derive(Debug, Error, traversable_error::TraversableError)]
pub enum Error {
#[error(transparent)]
Io(#[from] std::io::Error),

View file

@ -14,7 +14,7 @@ use thiserror::Error;
use tracing::trace;
use uv_fs::Simplified;
#[derive(Debug, Error)]
#[derive(Debug, Error, traversable_error::TraversableError)]
pub enum LibcDetectionError {
#[error("Could not detect either glibc version nor musl libc version, at least one of which is required")]
NoLibcFound,

View file

@ -27,7 +27,7 @@ use crate::platform::{Arch, Libc, Os};
use crate::python_version::PythonVersion;
use crate::{macos_dylib, sysconfig, PythonRequest, PythonVariant};
#[derive(Error, Debug)]
#[derive(Error, traversable_error::TraversableError, Debug)]
pub enum Error {
#[error(transparent)]
Io(#[from] io::Error),

View file

@ -5,7 +5,7 @@ use std::ops::Deref;
use std::{fmt, str::FromStr};
use thiserror::Error;
#[derive(Error, Debug)]
#[derive(Error, traversable_error::TraversableError, Debug)]
pub enum Error {
#[error("Unknown operating system: {0}")]
UnknownOs(String),

View file

@ -48,7 +48,7 @@ pub struct PyVenvConfiguration {
pub(crate) version: Option<PythonVersion>,
}
#[derive(Debug, Error)]
#[derive(Debug, Error, traversable_error::TraversableError)]
pub enum Error {
#[error(transparent)]
Io(#[from] io::Error),

View file

@ -125,7 +125,7 @@ fn read_registry_entry(company: &str, tag: &str, tag_key: &Key) -> Option<Window
})
}
#[derive(Debug, Error)]
#[derive(Debug, Error, traversable_error::TraversableError)]
pub enum ManagedPep514Error {
#[error("Windows has an unknown pointer width for arch: `{_0}`")]
InvalidPointerSize(Arch),