diff --git a/setup.py b/setup.py index 09202a658c..7861619410 100755 --- a/setup.py +++ b/setup.py @@ -13,12 +13,14 @@ NAME: str = dist.get_name() # type: ignore -# Check if building for Pyodide -is_pyodide = os.getenv("PYODIDE", "0") == "1" - -if is_pyodide: - # For pyodide we build a universal wheel that must be pure-python - # so we must omit the cython-version of scan. +# Build without optional compiled extensions. Keep PYODIDE as a compatibility +# alias for existing downstream builds. +is_pure_python = ( + os.getenv("PYTENSOR_PURE_PYTHON", "0") == "1" or os.getenv("PYODIDE", "0") == "1" +) + +if is_pure_python: + # Omit the optional Cython implementation of scan. ext_modules = [] else: ext_modules = [