From 939b75398dbbe3830239e4587b729569fa3171dc Mon Sep 17 00:00:00 2001 From: Feodor Fitsner Date: Wed, 26 Jun 2024 18:27:41 -0700 Subject: [PATCH] Override wheel tag with `_PYTHON_HOST_PLATFORM` (#2122) * Override wheel tag with _PYTHON_HOST_PLATFORM * Fix linting --- src/build_context.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/build_context.rs b/src/build_context.rs index 9e84a3604..91faf4f0d 100644 --- a/src/build_context.rs +++ b/src/build_context.rs @@ -519,6 +519,10 @@ impl BuildContext { /// Returns the platform part of the tag for the wheel name pub fn get_platform_tag(&self, platform_tags: &[PlatformTag]) -> Result { + if let Ok(host_platform) = env::var("_PYTHON_HOST_PLATFORM") { + return Ok(host_platform.replace(['.', '-'], "_")); + } + let target = &self.target; let tag = match (&target.target_os(), &target.target_arch()) { // Windows