forked from sdfxai/sdfx
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.sh
More file actions
executable file
·26 lines (21 loc) · 765 Bytes
/
Copy pathsetup.sh
File metadata and controls
executable file
·26 lines (21 loc) · 765 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/bin/bash
PYTHON_VERSION="3.11"
python_executable=""
if command -v python >/dev/null 2>&1; then
python_executable="python3"
elif command -v python3 >/dev/null 2>&1; then
python_executable="python"
else
echo "Error: Neither 'python' nor 'python3' found in the system."
exit 1
fi
# Get the installed Python version and extract major and minor components
python_version=$($python_executable --version 2>&1 | cut -d' ' -f2 | cut -d. -f1,2)
# Compare the version using awk
if awk 'BEGIN { if ("'"$python_version"'" <= "'"$PYTHON_VERSION"'") exit 1; else exit 0; }'; then
echo "Error: Python version $PYTHON_VERSION or later is required."
exit 1
fi
$python_executable -m venv .venv
source .venv/bin/activate
$python_executable setup.py "$@"