Skip to content

Commit

Permalink
Task/.bat: build all Py3.8-3.12 wheels at once
Browse files Browse the repository at this point in the history
  • Loading branch information
PierreRaybaut committed Oct 25, 2023
1 parent 7ebc054 commit 53640e8
Show file tree
Hide file tree
Showing 2 changed files with 71 additions and 0 deletions.
33 changes: 33 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,39 @@
"Clean Up",
]
},
{
"label": "Build all wheels",
"type": "shell",
"command": "cmd",
"options": {
"cwd": "scripts",
"env": {
"PYTHON": "${env:PPSTACK_PYTHONEXE}",
"UNATTENDED": "1",
}
},
"args": [
"/c",
"build_wheels.bat"
],
"problemMatcher": [],
"group": {
"kind": "build",
"isDefault": true
},
"presentation": {
"echo": true,
"reveal": "always",
"focus": false,
"panel": "shared",
"showReuseMessage": true,
"clear": true
},
"dependsOrder": "sequence",
"dependsOn": [
"Clean Up",
]
},
{
"label": "Build extensions in place",
"type": "shell",
Expand Down
38 changes: 38 additions & 0 deletions scripts/build_wheels.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
@echo off
REM This script was copied from PythonQwt project
REM ======================================================
REM Package build script
REM ======================================================
REM Licensed under the terms of the MIT License
REM Copyright (c) 2020 Pierre Raybaut
REM (see PythonQwt LICENSE file for more details)
REM ======================================================
setlocal enabledelayedexpansion
call %~dp0utils GetScriptPath SCRIPTPATH
call %FUNC% GetModName MODNAME
call %FUNC% SetPythonPath

if exist MANIFEST ( del /q MANIFEST )
:: Iterate over all directories in the grandparent directory
:: (WinPython base directories)
call %FUNC% GetPythonExeGrandParentDir DIR0
for /D %%d in ("%DIR0%*") do (
:: Get the directory name without the path
for %%n in (%%d) do set "DIRNAME=%%~nxn"

:: Check if the directory ends with "-PyQt6" or "-PySide6"
if not "!DIRNAME:~-6!"=="-PyQt6" (
if not "!DIRNAME:~-8!"=="-PySide6" (
set WINPYDIRBASE=%%d
set OLD_PATH=!PATH!
call !WINPYDIRBASE!\scripts\env.bat
echo ******************************************************************************
echo Building %MODNAME% from "%%d"
echo ******************************************************************************
python setup.py build bdist_wheel
echo ----
set PATH=!OLD_PATH!
)
)
)
call %FUNC% EndOfScript

0 comments on commit 53640e8

Please sign in to comment.