diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 1c4a5bc..d9e0620 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -11,9 +11,14 @@ jobs: build_wheels: name: Build wheels on ${{ matrix.os }} runs-on: ${{ matrix.os }} + env: + PURE_PYTHON: ${{ matrix.pure_python }} strategy: matrix: os: [ubuntu-latest, macos-latest, windows-latest] + include: + - os: ubuntu-latest + - pure_python: "true" fail-fast: false steps: diff --git a/setup.py b/setup.py index 2e9eac1..3f09f3c 100755 --- a/setup.py +++ b/setup.py @@ -1,9 +1,15 @@ #!/usr/bin/env python +import os import platform import setuptools -if platform.python_implementation() == "CPython": + +def _getenv_bool(key: str) -> bool: + return os.getenv(key, "false").lower() in ("true", "1") + + +if platform.python_implementation() == "CPython" and not _getenv_bool("PURE_PYTHON"): ext_modules = [ setuptools.Extension( "bitstruct.c",