@@ -21,6 +21,33 @@ WORK_DIR="$SCRIPT_DIR/test-project"
2121# SDK version to install (can be overridden via environment variable)
2222SDK_VERSION=" ${SDK_VERSION:- } "
2323
24+ # Detect platform and architecture
25+ detect_platform () {
26+ local os=$( uname -s | tr ' [:upper:]' ' [:lower:]' )
27+ local arch=$( uname -m)
28+
29+ # Map OS
30+ case " $os " in
31+ darwin) PLATFORM=" darwin" ;;
32+ linux) PLATFORM=" linux" ;;
33+ mingw* |msys* |cygwin* ) PLATFORM=" win32" ;;
34+ * ) echo -e " ${RED} Unsupported OS: $os ${NC} " ; exit 1 ;;
35+ esac
36+
37+ # Map architecture
38+ case " $arch " in
39+ x86_64|amd64) ARCH=" x64" ;;
40+ arm64|aarch64) ARCH=" arm64" ;;
41+ * ) echo -e " ${RED} Unsupported architecture: $arch ${NC} " ; exit 1 ;;
42+ esac
43+
44+ NATIVE_PACKAGE=" gopher-orch-native-${PLATFORM} -${ARCH} "
45+ echo -e " ${CYAN} Detected platform: ${PLATFORM} -${ARCH}${NC} "
46+ echo -e " ${CYAN} Native package: ${NATIVE_PACKAGE}${NC} "
47+ }
48+
49+ detect_platform
50+
2451# Kill any existing processes on ports 3001 and 3002
2552kill_port () {
2653 local port=$1
@@ -61,18 +88,20 @@ echo -e "${YELLOW}Creating virtual environment...${NC}"
6188python3 -m venv venv
6289source venv/bin/activate
6390
64- # Install SDK from TestPyPI
91+ # Install SDK and native package from TestPyPI
6592echo -e " ${YELLOW} Installing gopher-orch from TestPyPI...${NC} "
6693if [ -n " $SDK_VERSION " ]; then
6794 echo -e " ${CYAN} Installing version: $SDK_VERSION ${NC} "
6895 pip install --index-url https://test.pypi.org/simple/ \
6996 --extra-index-url https://pypi.org/simple/ \
70- " gopher-orch==$SDK_VERSION "
97+ " gopher-orch==$SDK_VERSION " \
98+ " ${NATIVE_PACKAGE} ==$SDK_VERSION "
7199else
72100 echo -e " ${CYAN} Installing latest version${NC} "
73101 pip install --index-url https://test.pypi.org/simple/ \
74102 --extra-index-url https://pypi.org/simple/ \
75- gopher-orch
103+ gopher-orch \
104+ " $NATIVE_PACKAGE "
76105fi
77106
78107# Show installed version
@@ -126,7 +155,7 @@ echo -e "${GREEN}Example completed${NC}"
126155echo " "
127156echo -e " ${CYAN} To run this example manually:${NC} "
128157echo " 1. python3 -m venv venv && source venv/bin/activate"
129- echo " 2. pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple/ gopher-orch"
158+ echo " 2. pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple/ gopher-orch $NATIVE_PACKAGE "
130159echo " 3. python client_example_json.py"
131160
132161exit 0
0 commit comments