Files
2026-08-03 22:14:19 +08:00

71 lines
1.9 KiB
Batchfile

@echo off
REM Build Nuitka wheels for Python 3.10, 3.11, and 3.12.
REM Expects conda envs named py310, py311, py312 (or set CONDA_ENVS_ROOT).
setlocal enabledelayedexpansion
cd /d "%~dp0\..\.."
if errorlevel 1 (
echo ERROR: Could not change to repository root.
exit /b 1
)
if not defined CONDA_ENVS_ROOT (
if exist "%USERPROFILE%\anaconda3\envs" (
set "CONDA_ENVS_ROOT=%USERPROFILE%\anaconda3\envs"
) else if exist "%USERPROFILE%\miniconda3\envs" (
set "CONDA_ENVS_ROOT=%USERPROFILE%\miniconda3\envs"
) else if exist "%LOCALAPPDATA%\anaconda3\envs" (
set "CONDA_ENVS_ROOT=%LOCALAPPDATA%\anaconda3\envs"
)
)
where conda >nul 2>&1
set "HAS_CONDA=0"
if not errorlevel 1 set "HAS_CONDA=1"
set FAILED=0
for %%E in (py310 py311 py312) do (
echo.
echo ========================================
echo Building orisys wheel: %%E
echo ========================================
set "OK=0"
if !HAS_CONDA! equ 1 (
call conda run --no-capture-output -n %%E python build\wheel\build.py
if not errorlevel 1 set "OK=1"
)
if !OK! equ 0 (
if not defined CONDA_ENVS_ROOT (
echo ERROR: Could not find conda env %%E. Set CONDA_ENVS_ROOT or add conda to PATH.
) else (
set "PYEXE=!CONDA_ENVS_ROOT!\%%E\python.exe"
if not exist "!PYEXE!" (
echo ERROR: Python not found: !PYEXE!
) else (
"!PYEXE!" build\wheel\build.py
if not errorlevel 1 set "OK=1"
)
)
)
if !OK! equ 0 set FAILED=1
)
echo.
if !FAILED! equ 1 (
echo One or more wheel builds failed.
exit /b 1
)
echo SUCCESS: all wheels built under SDK\
for /f "delims=" %%V in ('dir /b /ad SDK 2^>nul') do (
for %%W in ("SDK\%%V\orisys-*-cp310-*.whl" "SDK\%%V\orisys-*-cp311-*.whl" "SDK\%%V\orisys-*-cp312-*.whl") do (
if exist %%W echo %%~nxW
)
)
endlocal
exit /b 0