You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Error when a built wheel is for the wrong platform. This can happen especially when using `--python-platform` or `--python-version` with `uv pip install`.
Fixes#16019
Ready for review but I want to make some more testing before merging.
Copy file name to clipboardExpand all lines: crates/uv-distribution/src/error.rs
+31-1Lines changed: 31 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -6,11 +6,12 @@ use zip::result::ZipError;
6
6
7
7
usecrate::metadata::MetadataError;
8
8
use uv_client::WrappedReqwestError;
9
-
use uv_distribution_filename::WheelFilenameError;
9
+
use uv_distribution_filename::{WheelFilename,WheelFilenameError};
10
10
use uv_distribution_types::{InstalledDist,InstalledDistError,IsBuildBackendError};
11
11
use uv_fs::Simplified;
12
12
use uv_normalize::PackageName;
13
13
use uv_pep440::{Version,VersionSpecifiers};
14
+
use uv_platform_tags::Platform;
14
15
use uv_pypi_types::{HashAlgorithm,HashDigest};
15
16
use uv_redacted::DisplaySafeUrl;
16
17
use uv_types::AnyErrorBuild;
@@ -74,6 +75,35 @@ pub enum Error {
74
75
filename:Version,
75
76
metadata:Version,
76
77
},
78
+
/// This shouldn't happen, it's a bug in the build backend.
79
+
#[error(
80
+
"The wheel `{}` built from source distribution is not compatible with the current Python {}.{} on {} {}",
81
+
filename,
82
+
python_version.0,
83
+
python_version.1,
84
+
python_platform.os(),
85
+
python_platform.arch(),
86
+
)]
87
+
BuiltWheelIncompatibleHostPlatform{
88
+
filename:WheelFilename,
89
+
python_platform:Platform,
90
+
python_version:(u8,u8),
91
+
},
92
+
/// This may happen when trying to cross-install native dependencies without their build backend
93
+
/// being aware that the target is a cross-install.
94
+
#[error(
95
+
"The wheel `{}` built from source distribution is not compatible with the target Python {}.{} on {} {}. Consider using `--no-build` to disable building wheels.",
96
+
filename,
97
+
python_version.0,
98
+
python_version.1,
99
+
python_platform.os(),
100
+
python_platform.arch(),
101
+
)]
102
+
BuiltWheelIncompatibleTargetPlatform{
103
+
filename:WheelFilename,
104
+
python_platform:Platform,
105
+
python_version:(u8,u8),
106
+
},
77
107
#[error("Failed to parse metadata from built wheel")]
78
108
Metadata(#[from] uv_pypi_types::MetadataError),
79
109
#[error("Failed to read metadata: `{}`", _0.user_display())]
0 commit comments