PyAPI: drop support for Python 3.10

All platforms have been updated to support 3.11
so supporting 3.10 is no longer needed.
This commit is contained in:
Campbell Barton 2024-01-09 22:23:41 +11:00
parent f11ec3eb14
commit 5afd33d129
4 changed files with 12 additions and 11 deletions

View File

@ -1234,10 +1234,10 @@ if(WITH_PYTHON)
# Do this before main 'platform_*' checks,
# because UNIX will search for the old Python paths which may not exist.
# giving errors about missing paths before this case is met.
if(DEFINED PYTHON_VERSION AND "${PYTHON_VERSION}" VERSION_LESS "3.10")
if(DEFINED PYTHON_VERSION AND "${PYTHON_VERSION}" VERSION_LESS "3.11")
message(
FATAL_ERROR
"At least Python 3.10 is required to build, but found Python ${PYTHON_VERSION}"
"At least Python 3.11 is required to build, but found Python ${PYTHON_VERSION}"
)
endif()

View File

@ -223,9 +223,6 @@ ifeq (, $(wildcard $(LIBDIR)/python/lib/python$(PY_LIB_VERSION)))
PY_LIB_VERSION:=3.12
ifeq (, $(wildcard $(LIBDIR)/python/lib/python$(PY_LIB_VERSION)))
PY_LIB_VERSION:=3.11
ifeq (, $(wildcard $(LIBDIR)/python/lib/python$(PY_LIB_VERSION)))
PY_LIB_VERSION:=3.10
endif
endif
endif
endif

View File

@ -555,11 +555,15 @@ endif()
set(_PYTHON_VERSION "3.11")
string(REPLACE "." "" _PYTHON_VERSION_NO_DOTS ${_PYTHON_VERSION})
if(NOT EXISTS ${LIBDIR}/python/${_PYTHON_VERSION_NO_DOTS})
set(_PYTHON_VERSION "3.10")
string(REPLACE "." "" _PYTHON_VERSION_NO_DOTS ${_PYTHON_VERSION})
# Enable for a short time when bumping to the next Python version.
if(FALSE)
if(NOT EXISTS ${LIBDIR}/python/${_PYTHON_VERSION_NO_DOTS})
message(FATAL_ERROR "Missing python libraries! Neither 3.11 nor 3.10 are found in ${LIBDIR}/python")
set(_PYTHON_VERSION "3.12")
string(REPLACE "." "" _PYTHON_VERSION_NO_DOTS ${_PYTHON_VERSION})
if(NOT EXISTS ${LIBDIR}/python/${_PYTHON_VERSION_NO_DOTS})
message(FATAL_ERROR "Missing python libraries! Neither 3.12 nor 3.11 are found in ${LIBDIR}/python")
endif()
endif()
endif()

View File

@ -10,8 +10,8 @@
#include <Python.h>
#if PY_VERSION_HEX < 0x030a0000
# error "Python 3.10 or greater is required, you'll need to update your Python."
#if PY_VERSION_HEX < 0x030b0000
# error "Python 3.11 or greater is required, you'll need to update your Python."
#endif
#ifdef __cplusplus