Skip to content

Commit 21bcc22

Browse files
author
Bob Strahan
committed
fix: add Python 3.12 version check to publish script
1 parent 37e6224 commit 21bcc22

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

publish.sh

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,20 @@ function check_prerequisites() {
100100
exit 1
101101
fi
102102

103+
# Check Python version
104+
if command -v python3 &>/dev/null; then
105+
local python_version=$(python3 -c 'import sys; print(f"{sys.version_info.major}.{sys.version_info.minor}")')
106+
local min_python_version="3.12"
107+
if [[ $(echo -e "$min_python_version\n$python_version" | sort -V | head -n1) != $min_python_version ]]; then
108+
echo "Error: Python version >= $min_python_version is required. (Installed version is $python_version)" >&2
109+
echo "Please upgrade your Python installation." >&2
110+
exit 1
111+
fi
112+
else
113+
echo "Error: Python 3 is not installed or not in PATH" >&2
114+
exit 1
115+
fi
116+
103117
# Set platform-specific commands
104118
if [[ $(uname -m) == "x86_64" ]]; then
105119
USE_CONTAINER_FLAG=""

0 commit comments

Comments
 (0)