Closes #19889: Drop support for Python 3.10 & 3.11

This commit is contained in:
Jeremy Stretch
2025-09-02 15:38:32 -04:00
parent d8822c8bca
commit b1439dc298
10 changed files with 15 additions and 27 deletions

View File

@@ -4,7 +4,7 @@
# This script will invoke Python with the value of the PYTHON environment
# variable (if set), or fall back to "python3". Note that NetBox v4.0+ requires
# Python 3.10 or later.
# Python 3.12 or later.
# Parse arguments
if [[ "$1" == "--readonly" ]]; then
@@ -22,15 +22,15 @@ VIRTUALENV="$(pwd -P)/venv"
PYTHON="${PYTHON:-python3}"
# Validate the minimum required Python version
COMMAND="${PYTHON} -c 'import sys; exit(1 if sys.version_info < (3, 10) else 0)'"
COMMAND="${PYTHON} -c 'import sys; exit(1 if sys.version_info < (3, 12) else 0)'"
PYTHON_VERSION=$(eval "${PYTHON} -V")
eval $COMMAND || {
echo "--------------------------------------------------------------------"
echo "ERROR: Unsupported Python version: ${PYTHON_VERSION}. NetBox requires"
echo "Python 3.10 or later. To specify an alternate Python executable, set"
echo "Python 3.12 or later. To specify an alternate Python executable, set"
echo "the PYTHON environment variable. For example:"
echo ""
echo " sudo PYTHON=/usr/bin/python3.10 ./upgrade.sh"
echo " sudo PYTHON=/usr/bin/python3.12 ./upgrade.sh"
echo ""
echo "To show your current Python version: ${PYTHON} -V"
echo "--------------------------------------------------------------------"