Skip to content

Commit c148ce0

Browse files
committed
maint: rename build files for consistency
1 parent 029ec02 commit c148ce0

9 files changed

+68
-67
lines changed

.github/workflows/buildwheel.yml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
with:
2424
msystem: mingw64
2525
# path-type inherit is used so that when cibuildwheel calls msys2 to
26-
# run bin/cibw_prepare_python_windows.sh the virtual environment
26+
# run bin/cibw_before_build_windows.sh the virtual environment
2727
# created by cibuildwheel will be available within msys2. The
2828
# msys2/setup-msys2 README warns that using inherit here can be
2929
# problematic in some situations. Maybe there is a better way to do
@@ -39,17 +39,18 @@ jobs:
3939
#CIBW_SKIP: "*-win32 *-musllinux_*"
4040
CIBW_MANYLINUX_X86_64_IMAGE: manylinux2014
4141
CIBW_MANYLINUX_I686_IMAGE: manylinux2014
42-
CIBW_BEFORE_ALL_LINUX: bin/cibw_before_build_linux.sh
43-
CIBW_BEFORE_ALL_MACOS: bin/cibw_before_build_macosx.sh
44-
CIBW_BEFORE_ALL_WINDOWS: msys2 -c bin/cibw_before_build_windows.sh
45-
CIBW_BEFORE_BUILD_WINDOWS: msys2 -c bin/cibw_prepare_python_windows.sh
42+
CIBW_BEFORE_ALL_LINUX: bin/cibw_before_all_linux.sh
43+
CIBW_BEFORE_ALL_MACOS: bin/cibw_before_all_macosx.sh
44+
CIBW_BEFORE_ALL_WINDOWS: msys2 -c bin/cibw_before_all_windows.sh
45+
CIBW_BEFORE_BUILD_WINDOWS: msys2 -c bin/cibw_before_build_windows.sh
4646
CIBW_BEFORE_BUILD: pip install numpy cython delvewheel
4747
CIBW_ENVIRONMENT: >
4848
C_INCLUDE_PATH=$(pwd)/.local/include/
4949
LIBRARY_PATH=$(pwd)/.local/lib/
5050
LD_LIBRARY_PATH=$(pwd)/.local/lib:$LD_LIBRARY_PATH
5151
PYTHON_FLINT_MINGW64=true
52-
CIBW_REPAIR_WHEEL_COMMAND_WINDOWS: bin\repair_mingw_wheel.bat {dest_dir} {wheel}
52+
CIBW_REPAIR_WHEEL_COMMAND_WINDOWS: >-
53+
bin\cibw_repair_wheel_command_windows.bat {dest_dir} {wheel}
5354
CIBW_TEST_COMMAND: python -c "import flint; print(str(flint.fmpz(2)))"
5455

5556
- uses: actions/upload-artifact@v3

bin/cibw.bat

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@ del /q wheelhouse\*
2323

2424
set CIBW_BUILD=cp39-* cp310-* cp311-*
2525
set CIBW_SKIP=*-win32 *-manylinux_i686 *-musllinux_*
26-
set CIBW_BEFORE_ALL_WINDOWS=C:\msys64\usr\bin\bash bin/cibw_before_build_windows.sh
27-
set CIBW_BEFORE_BUILD_WINDOWS=C:\msys64\usr\bin\bash bin/cibw_prepare_python_windows.sh
26+
set CIBW_BEFORE_ALL_WINDOWS=C:\msys64\usr\bin\bash bin/cibw_before_all_windows.sh
27+
set CIBW_BEFORE_BUILD_WINDOWS=C:\msys64\usr\bin\bash bin/cibw_before_build_windows.sh
2828
set CIBW_ENVIRONMENT=PYTHON_FLINT_MINGW64=true
29-
set CIBW_REPAIR_WHEEL_COMMAND_WINDOWS=bin\repair_mingw_wheel.bat {dest_dir} {wheel}
29+
set CIBW_REPAIR_WHEEL_COMMAND_WINDOWS=bin\cibw_repair_wheel_command_windows.bat {dest_dir} {wheel}
3030
set CIBW_TEST_COMMAND=python -c "import flint; print(str(flint.fmpz(2)))"
3131

3232
cibuildwheel --platform windows
File renamed without changes.
File renamed without changes.

bin/cibw_before_all_windows.sh

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#!/bin/bash
2+
3+
set -o errexit
4+
5+
# Uncomment this to run cibuildwheel locally on Windows:
6+
# export PATH=$PATH:/c/msys64/usr/bin:/c/msys64/mingw64/bin
7+
8+
#
9+
# Make a setup.cfg to specify compiling with mingw64 (even though it says
10+
# mingw32...)
11+
#
12+
echo '[build]' > setup.cfg
13+
echo 'compiler = mingw32' >> setup.cfg
14+
cat setup.cfg
15+
16+
# Install the mingw-w64 toolchain
17+
pacman -S --noconfirm mingw-w64-x86_64-gcc m4 make mingw-w64-x86_64-tools-git
18+
19+
# This takes ~30mins
20+
bin/build_dependencies_unix.sh

bin/cibw_before_build_windows.sh

100755100644
Lines changed: 36 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,39 @@ set -o errexit
55
# Uncomment this to run cibuildwheel locally on Windows:
66
# export PATH=$PATH:/c/msys64/usr/bin:/c/msys64/mingw64/bin
77

8-
#
9-
# Make a setup.cfg to specify compiling with mingw64 (even though it says
10-
# mingw32...)
11-
#
12-
echo '[build]' > setup.cfg
13-
echo 'compiler = mingw32' >> setup.cfg
14-
cat setup.cfg
15-
16-
# Install the mingw-w64 toolchain
17-
pacman -S --noconfirm mingw-w64-x86_64-gcc m4 make mingw-w64-x86_64-tools-git
18-
19-
# This takes ~30mins
20-
bin/build_dependencies_unix.sh
8+
# VER should be set be e.g. 310 for Python 3.10
9+
VER=`python -c 'import sys; print("%s%s" % sys.version_info[:2])'`
10+
echo VER=${VER}
11+
12+
###################################################
13+
# Find parent Python installation from the venv #
14+
###################################################
15+
16+
which python
17+
PYTHONBIN=`dirname $(which python)`
18+
PYTHONDIR=`dirname $PYTHONBIN`
19+
cfgfile=$PYTHONDIR/pyvenv.cfg
20+
homeline=`grep home $cfgfile`
21+
homepath=${homeline#*=}
22+
23+
echo ---------------------------------------------------
24+
echo $homepath
25+
echo ---------------------------------------------------
26+
27+
###################################################
28+
# Find pythonXX.dll and make a .a library #
29+
###################################################
30+
31+
cd $homepath
32+
gendef python${VER}.dll
33+
dlltool --dllname python${VER}.dll \
34+
--def python${VER}.def \
35+
--output-lib libpython${VER}.a
36+
37+
mv libpython${VER}.a libs
38+
39+
###################################################
40+
# Install build dependencies #
41+
###################################################
42+
43+
pip install Cython numpy delvewheel

bin/cibw_prepare_python_windows.sh

Lines changed: 0 additions & 43 deletions
This file was deleted.

bin/repair_mingw_wheel.bat renamed to bin/cibw_repair_wheel_command_windows.bat

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@ set tempfile=tmpfile.deleteme
99
set WHEELHOUSE=%1
1010
set WHEELNAME=%2
1111

12-
msys2 -c bin/repair_mingw_wheel.sh
13-
rem C:\msys64\usr\bin\bash bin/repair_mingw_wheel.sh
12+
msys2 -c bin/cibw_repair_wheel_command_windows.sh
13+
rem C:\msys64\usr\bin\bash bin/cibw_repair_wheel_command_windows.sh
File renamed without changes.

0 commit comments

Comments
 (0)