1
0
Эх сурвалжийг харах

Moving conditonal apple silicon logic to setup.py

willschneider15 9 сар өмнө
parent
commit
ae47fe11e6
2 өөрчлөгдсөн 6 нэмэгдсэн , 9 устгасан
  1. 1 9
      install.sh
  2. 5 0
      setup.py

+ 1 - 9
install.sh

@@ -2,12 +2,4 @@
 
 python3 -m venv .venv
 source .venv/bin/activate
-
-# Check if running on macOS with Apple Silicon
-if [[ "$(uname)" == "Darwin" && "$(uname -m)" == "arm64" ]]; then
-    echo "Installing with Apple Silicon support..."
-    pip install -e ".[apple_silicon]"
-else
-    echo "Installing without Apple Silicon support..."
-    pip install -e .
-fi
+pip install -e .

+ 5 - 0
setup.py

@@ -1,4 +1,5 @@
 import sys
+import platform
 
 from setuptools import find_packages, setup
 
@@ -40,6 +41,10 @@ extras_require = {
   ],
 }
 
+# Check if running on macOS with Apple Silicon
+if sys.platform.startswith("darwin") and platform.machine() == "arm64":
+  install_requires.extend(extras_require["apple_silicon"])
+
 setup(
   name="exo",
   version="0.0.1",