From 7a19532660c489a2a6d8c89ed842ae3e031e4b1f Mon Sep 17 00:00:00 2001 From: JP-Ellis Date: Thu, 7 Mar 2024 11:50:43 +1100 Subject: [PATCH] chore(ci): adapt before-build for windows The `rm` and `mv` commands don't work well within Windows' default shell. As a result, a separate script for Windows is required. Signed-off-by: JP-Ellis --- pyproject.toml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index 3f6eca4fb..0277a750c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -315,3 +315,11 @@ assert isinstance(pact.v3.ffi.version(), str);\"""" # The repair tool unfortunately did not like the bundled Ruby distributable. # TODO: Check whether delocate-wheel can be configured. repair-wheel-command = "" + +[tool.cibuildwheel.windows] +before-build = [ + 'FOR /R src\pact\v3 %G IN (_ffi.*) DO IF NOT %~nxG == _ffi.pyi DEL /F /Q "%G"', + 'IF EXIST src\pact\v3\bin\ RMDIR /S /Q src\pact\v3\bin', + 'IF EXIST src\pact\v3\data\ RMDIR /S /Q src\pact\v3\data', + 'IF EXIST src\pact\v3\lib\ RMDIR /S /Q src\pact\v3\lib', +]