From 44ba25b671e88abe19b9961a036f542d39bd9a75 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Sun, 2 Oct 2022 09:12:01 -1000 Subject: [PATCH] chore: make sure cython build is successful or raise when building wheels --- .github/workflows/wheels.yml | 1 + build.py | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index 7b6b68ae..9d87d8a1 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -33,6 +33,7 @@ jobs: env: CIBW_SKIP: cp36-* CIBW_BEFORE_ALL_LINUX: apt-get install -y gcc || yum install -y gcc || apk add gcc + REQUIRE_CYTHON: 1 - uses: actions/upload-artifact@v3 with: diff --git a/build.py b/build.py index 4eca0540..85e7098a 100644 --- a/build.py +++ b/build.py @@ -16,7 +16,7 @@ def build_extensions(self): def build(setup_kwargs): if os.environ.get("SKIP_CYTHON", False): return - with contextlib.suppress(Exception): + try: from Cython.Build import cythonize setup_kwargs.update( @@ -30,3 +30,7 @@ def build(setup_kwargs): cmdclass=dict(build_ext=BuildExt), ) ) + except Exception: + if os.environ.get("REQUIRE_CYTHON"): + raise + pass