cmake: Add Python 3.14 support

This commit is contained in:
Corentin Le Molgat
2025-11-21 16:27:05 +01:00
parent 5d31a932d6
commit cf21748fdb
14 changed files with 53 additions and 8 deletions

View File

@@ -26,6 +26,7 @@ jobs:
#{version: '3.11'},
{version: '3.12'},
#{version: '3.13'},
#{version: '3.14'},
]
fail-fast: false
env:

View File

@@ -28,6 +28,7 @@ jobs:
#{version: "3.11"},
#{version: "3.12"},
{version: "3.13"},
{version: "3.14"},
]
fail-fast: false
name: amd64•Linux•CMake•Python${{matrix.python.version}}

View File

@@ -26,6 +26,7 @@ jobs:
#{version: '3.11'},
{version: '3.12'},
#{version: '3.13'},
#{version: '3.14'},
]
fail-fast: false
env:

View File

@@ -32,6 +32,7 @@ jobs:
#{version: "3.11"},
#{version: "3.12"},
{version: "3.13"},
{version: "3.14"},
]
fail-fast: false
name: amd64•MacOS•CMake(${{matrix.cmake.name}})•Python-${{matrix.python.version}}

View File

@@ -26,6 +26,7 @@ jobs:
# {version: '3.11'},
{version: '3.12'},
# {version: '3.13'},
# {version: '3.14'},
]
fail-fast: false # Don't cancel all jobs if one fails.
env:

View File

@@ -27,6 +27,7 @@ jobs:
#{version: "3.11", dir: Python311},
#{version: "3.12", dir: Python312},
{version: "3.13", dir: Python313},
{version: "3.14", dir: Python314},
]
fail-fast: false
name: amd64•Windows•CMake(${{matrix.cmake.name}})•Python-${{matrix.python.version}}

View File

@@ -26,6 +26,7 @@ jobs:
#{version: '3.11'},
{version: '3.12'},
#{version: '3.13'},
#{version: '3.14'},
]
fail-fast: false
env:

View File

@@ -32,6 +32,7 @@ jobs:
#{version: "3.11"},
{version: "3.12"},
#{version: "3.13"},
#{version: "3.14"},
]
fail-fast: false
name: arm64•MacOS•CMake(${{matrix.cmake.name}})•Python-${{matrix.python.version}}

View File

@@ -166,6 +166,7 @@ setup(
'Programming Language :: Python :: 3.11',
'Programming Language :: Python :: 3.12',
'Programming Language :: Python :: 3.13',
'Programming Language :: Python :: 3.14',
'Programming Language :: C++',
'Programming Language :: Python :: Implementation :: CPython',
'Topic :: Office/Business :: Scheduling',

View File

@@ -59,6 +59,7 @@ help:
@echo -e "\t\t${BOLD}311${RESET} Python3.11"
@echo -e "\t\t${BOLD}312${RESET} Python3.12"
@echo -e "\t\t${BOLD}313${RESET} Python3.13"
@echo -e "\t\t${BOLD}314${RESET} Python3.14"
@echo
@echo -e "\t${BOLD}<step>${RESET}:"
@echo -e "\t\t${BOLD}env${RESET}"
@@ -204,7 +205,7 @@ cache/python: | cache
-mkdir $@
## MANYLINUX ##
PYTHON_VERSIONS := 39 310 311 312 313
PYTHON_VERSIONS := 39 310 311 312 313 314
export/python/manylinux: | export/python
-mkdir -p $@

View File

@@ -225,9 +225,9 @@ function build_python() {
echo "DONE" | tee -a build.log
if [[ ${PLATFORM} == "arm64" ]]; then
local -r PY=(3.9 3.10 3.11 3.12 3.13)
local -r PY=(3.9 3.10 3.11 3.12 3.13 3.14)
else
local -r PY=(3.9 3.10 3.11 3.12 3.13)
local -r PY=(3.9 3.10 3.11 3.12 3.13 3.14)
fi
# Check Python env

View File

@@ -269,7 +269,7 @@ set PATH=%userprofile%\AppData\Roaming\Python\Python3%1\Scripts;%PATH%
::echo "python path: %PATH%"
GOTO :eof
REM PYTHON 3.9, 3.10, 3.11, 3.12, 3.13
REM PYTHON 3.9, 3.10, 3.11, 3.12, 3.13, 3.14
:BUILD_PYTHON
title Build Python
set HASH=
@@ -279,7 +279,7 @@ echo Python build seems up to date, skipping
exit /B 0
)
FOR %%v IN (9 10 11 12 13) DO (
FOR %%v IN (9 10 11 12 13 14) DO (
title Build Python 3.%%v
echo Check python3.%%v... | tee.exe -a build.log
which.exe "C:\python3%%v-64\python.exe" || exit 1
@@ -342,7 +342,7 @@ del /s /f /q temp_dotnet
rmdir /s /q temp_dotnet
del /s /f /q temp_java
rmdir /s /q temp_java
FOR %%v IN (9 10 11 12 13) do (
FOR %%v IN (9 10 11 12 13 14) do (
del /s /f /q temp_python3%%v
rmdir /s /q temp_python3%%v
)

View File

@@ -23,9 +23,9 @@ command -v make | xargs echo "make: " | tee -a test.log
command -v swig | xargs echo "swig: " | tee -a test.log
# python
if [[ ${PLATFORM} == "arm64" ]]; then
local -r PY=(3.9 3.10 3.11 3.12 3.13)
local -r PY=(3.9 3.10 3.11 3.12 3.13 3.14)
else
local -r PY=(3.9 3.10 3.11 3.12 3.13)
local -r PY=(3.9 3.10 3.11 3.12 3.13 3.14)
fi
for i in "${PY[@]}"; do

View File

@@ -21,6 +21,8 @@ which.exe C:\python312-64\python.exe || exit 1
echo C:\python312-64\python.exe: FOUND | tee.exe -a test.log
which.exe C:\python313-64\python.exe || exit 1
echo C:\python313-64\python.exe: FOUND | tee.exe -a test.log
which.exe C:\python314-64\python.exe || exit 1
echo C:\python314-64\python.exe: FOUND | tee.exe -a test.log
set LOCAL_PATH=%PATH%
@@ -188,3 +190,36 @@ echo Testing ortools Python3.13... | tee.exe -a test.log
echo Testing ortools Python3.13...DONE | tee.exe -a test.log
FOR %%i IN (%TEMP_DIR%\ortools\dist\*.whl) DO copy %%i .
REM ###################
REM ## PYTHON 3.14 ##
REM ###################
echo Cleaning Python... | tee.exe -a test.log
make.exe clean_python WINDOWS_PATH_TO_PYTHON=c:\python314-64
echo Cleaning Python...DONE | tee.exe -a test.log
REM make.exe python WINDOWS_PATH_TO_PYTHON=c:\python314-64 || exit 1
REM echo make python3.14: DONE | tee.exe -a build.log
REM make.exe test_python WINDOWS_PATH_TO_PYTHON=c:\python314-64 || exit 1
REM echo make test_python3.14: DONE | tee.exe -a build.log
echo Rebuild Python3.14 pypi archive... | tee.exe -a test.log
make.exe package_python WINDOWS_PATH_TO_PYTHON=c:\python314-64 || exit 1
echo Rebuild Python3.14 pypi archive...DONE | tee.exe -a test.log
echo Creating Python3.14 venv... | tee.exe -a test.log
set PATH=c:\python314-64;c:\python314-64\Scripts;%PATH%
python -m pip install virtualenv
set TEMP_DIR=temp_python314
python -m virtualenv %TEMP_DIR%\venv
set PATH=%LOCAL_PATH%
echo Creating Python3.14 venv...DONE | tee.exe -a test.log
echo Installing ortools Python3.14 venv... | tee.exe -a test.log
FOR %%i IN (%TEMP_DIR%\ortools\dist\*.whl) DO %TEMP_DIR%\venv\Scripts\python -m pip install %%i
echo Installing ortools Python3.14 venv...DONE | tee.exe -a test.log
echo Testing ortools Python3.14... | tee.exe -a test.log
%TEMP_DIR%\venv\Scripts\python cmake\samples\python\sample.py 2>&1 | tee.exe -a test.log
echo Testing ortools Python3.14...DONE | tee.exe -a test.log
FOR %%i IN (%TEMP_DIR%\ortools\dist\*.whl) DO copy %%i .