-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathverify_python_version.sh
More file actions
executable file
·64 lines (56 loc) · 1.8 KB
/
verify_python_version.sh
File metadata and controls
executable file
·64 lines (56 loc) · 1.8 KB
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#!/usr/bin/env bash
# Script to verify if a Python version exists in a specific release
PYTHON_VERSION="${1:-3.12.7}"
RELEASE_DATE="${2:-20250918}"
echo "🔍 Checking Python $PYTHON_VERSION in release $RELEASE_DATE"
echo ""
# Detect platform
OS=$(uname -s)
ARCH=$(uname -m)
case "$OS" in
Darwin)
if [ "$ARCH" = "arm64" ]; then
PLATFORM="aarch64-apple-darwin"
else
PLATFORM="x86_64-apple-darwin"
fi
;;
Linux)
if [ "$ARCH" = "x86_64" ]; then
PLATFORM="x86_64-unknown-linux-gnu"
elif [ "$ARCH" = "aarch64" ]; then
PLATFORM="aarch64-unknown-linux-gnu"
fi
;;
esac
echo "Platform: $PLATFORM"
echo ""
# Construct URL
BASE_URL="https://github.com/astral-sh/python-build-standalone/releases/download"
FILENAME="cpython-${PYTHON_VERSION}+${RELEASE_DATE}-${PLATFORM}-install_only.tar.gz"
URL="${BASE_URL}/${RELEASE_DATE}/${FILENAME}"
echo "Testing URL:"
echo "$URL"
echo ""
# Check if URL exists
if curl --output /dev/null --silent --head --fail "$URL"; then
echo "✅ SUCCESS: Python $PYTHON_VERSION exists in release $RELEASE_DATE"
echo ""
echo "You can use:"
echo " PYTHON_VERSION=\"$PYTHON_VERSION\""
echo " release_date=\"$RELEASE_DATE\""
exit 0
else
echo "❌ NOT FOUND: Python $PYTHON_VERSION does not exist in release $RELEASE_DATE"
echo ""
echo "💡 Suggestions:"
echo " 1. Check available versions at:"
echo " https://github.com/astral-sh/python-build-standalone/releases/tag/$RELEASE_DATE"
echo ""
echo " 2. Try latest release (20250918) with latest Python patches:"
echo " Python 3.14.x, 3.13.x, 3.12.x, 3.11.x, 3.10.x"
echo ""
echo " 3. Use this script to test:"
echo " ./verify-python-version.sh 3.13.9 20250918"
exit 1
fi