From c33476070c412d87c0fb9ddd4162e290f7b10928 Mon Sep 17 00:00:00 2001 From: Vitaly Zdanevich Date: Sun, 5 Jul 2026 02:38:16 +0400 Subject: [PATCH] THRIFT-5955 Require C extension in Python wheels Keep cibuildwheel release builds from silently falling back to pure-Python wheels when the fastbinary C extension fails to compile. The upstream PyPI workflow already builds manylinux aarch64 wheels; this guard makes those release wheels fail fast instead of publishing incomplete binary artifacts. Co-authored-by: OpenAI ChatGPT --- lib/py/setup.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/py/setup.py b/lib/py/setup.py index ca77ec08ad..75182d38fd 100644 --- a/lib/py/setup.py +++ b/lib/py/setup.py @@ -149,6 +149,12 @@ def run_setup(with_binary): print() print('*' * 80) print("An error occurred while trying to compile with the C extension enabled") + + if os.environ.get('CIBUILDWHEEL') == '1': + print('Refusing to build a release wheel without the C extension') + print('*' * 80) + raise + print("Attempting to build without the extension now") print('*' * 80) print()