From a0ec717a52180b4c5039a71ba15efd5adbeb9296 Mon Sep 17 00:00:00 2001 From: anutosh491 Date: Mon, 10 Aug 2026 10:57:26 +0530 Subject: [PATCH] Add a generic pure-Python build option --- setup.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) 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 = [