Skip to content

Commit 39d2b94

Browse files
Merge pull request #123 from mkoeppe/cibw_pyproject_toml
pyproject.toml: Move settings of CIBW_* here
2 parents 4439f12 + 117cf3d commit 39d2b94

File tree

5 files changed

+37
-47
lines changed

5 files changed

+37
-47
lines changed

.github/workflows/buildwheel.yml

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -34,23 +34,9 @@ jobs:
3434
- name: Build wheels
3535
uses: pypa/[email protected]
3636
env:
37-
CIBW_BUILD: cp39-* cp310-* cp311-* cp312-*
38-
CIBW_SKIP: "*-win32 *-manylinux_i686 *-musllinux_*"
39-
CIBW_MANYLINUX_X86_64_IMAGE: manylinux2014
40-
CIBW_MANYLINUX_I686_IMAGE: manylinux2014
41-
CIBW_BEFORE_ALL_LINUX: bin/cibw_before_all_linux.sh
42-
CIBW_BEFORE_ALL_MACOS: bin/cibw_before_all_macosx_x86_64.sh
37+
# override setting in pyproject.toml to use msys2 instead of msys64 bash
4338
CIBW_BEFORE_ALL_WINDOWS: msys2 -c bin/cibw_before_all_windows.sh
44-
CIBW_BEFORE_BUILD_WINDOWS: msys2 -c bin/cibw_before_build_windows.sh
45-
CIBW_BEFORE_BUILD: pip install numpy setuptools cython delvewheel
46-
CIBW_ENVIRONMENT: >
47-
C_INCLUDE_PATH=$(pwd)/.local/include/
48-
LIBRARY_PATH=$(pwd)/.local/lib/
49-
LD_LIBRARY_PATH=$(pwd)/.local/lib:$LD_LIBRARY_PATH
50-
PYTHON_FLINT_MINGW64=true
51-
CIBW_REPAIR_WHEEL_COMMAND_WINDOWS: >-
52-
bin\cibw_repair_wheel_command_windows.bat {dest_dir} {wheel}
53-
CIBW_TEST_COMMAND: python -c "import flint; print(str(flint.fmpz(2)))"
39+
CIBW_BEFORE_BUILD_WINDOWS: pip install delvewheel && msys2 -c bin/cibw_before_build_windows.sh
5440

5541
- uses: actions/upload-artifact@v4
5642
with:

bin/build_dependencies_unix.sh

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ if [ $USE_GMP = "gmp" ]; then
174174
--enable-shared=yes\
175175
--enable-static=no\
176176
--host=$HOST_ARG
177-
make -j3
177+
make -j6
178178
make install
179179

180180
cd ..
@@ -195,7 +195,7 @@ else
195195
tar xf yasm-$YASMVER.tar.gz
196196
cd yasm-$YASMVER
197197
./configure --prefix=$PREFIX
198-
make -j3
198+
make -j6
199199
make install
200200
cd ..
201201

@@ -226,7 +226,7 @@ else
226226
--enable-shared=yes\
227227
--enable-static=no\
228228
--enable-gmpcompat
229-
make -j3
229+
make -j6
230230
make install
231231
cd ..
232232

@@ -260,7 +260,7 @@ else
260260
--with-gmp=$PREFIX\
261261
--enable-shared=yes\
262262
--enable-static=no
263-
make -j3
263+
make -j6
264264
make install
265265
cd ..
266266
fi
@@ -285,7 +285,7 @@ cd flint-$FLINTVER
285285
$FLINTARB_WITHGMP\
286286
--with-mpfr=$PREFIX\
287287
--disable-static
288-
make -j3
288+
make -j6
289289
make install
290290
cd ..
291291

@@ -312,7 +312,7 @@ if [ $BUILD_ARB = "yes" ]; then
312312
$FLINTARB_WITHGMP\
313313
--with-mpfr=$PREFIX\
314314
--disable-static
315-
make -j3
315+
make -j6
316316
make install
317317
#
318318
# Set PATH so that DLLs are picked up on Windows.

bin/cibw.bat

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,7 @@ rem wheels from a previous run so we delete them here.
2121
rem
2222
del /q wheelhouse\*
2323

24+
rem override setting in pyproject.toml
2425
set CIBW_BUILD=cp39-* cp310-* cp311-*
25-
set CIBW_SKIP=*-win32 *-manylinux_i686 *-musllinux_*
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
28-
set CIBW_ENVIRONMENT=PYTHON_FLINT_MINGW64=true
29-
set CIBW_REPAIR_WHEEL_COMMAND_WINDOWS=bin\cibw_repair_wheel_command_windows.bat {dest_dir} {wheel}
30-
set CIBW_TEST_COMMAND=python -c "import flint; print(str(flint.fmpz(2)))"
3126

3227
cibuildwheel --platform windows

bin/cibw.sh

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -8,28 +8,10 @@
88

99
rm -f wheelhouse/*
1010

11-
# bin/build_dependencies_unix.sh places headers and shared libraries under .local
12-
export CIBW_ENVIRONMENT='C_INCLUDE_PATH=$(pwd)/.local/include/ LIBRARY_PATH=$(pwd)/.local/lib/ LD_LIBRARY_PATH=$(pwd)/.local/lib:$LD_LIBRARY_PATH PYTHON_FLINT_MINGW64=true'
13-
14-
export CIBW_BUILD='cp39-* cp310-* cp311-* cp312-*'
15-
# export CIBW_BUILD='cp311-*'
16-
export CIBW_SKIP='*-win32 *-manylinux_i686 *-musllinux_*'
17-
1811
# export CIBW_ARCHS_MACOS="x86_64"
1912
export CIBW_ARCHS_MACOS="arm64"
2013

21-
export CIBW_BEFORE_ALL_LINUX=bin/cibw_before_all_linux.sh
22-
# export CIBW_BEFORE_ALL_MACOS=bin/cibw_before_all_macosx_x86_64.sh
23-
export CIBW_BEFORE_ALL_MACOS=bin/cibw_before_all_macosx_arm64.sh
24-
export CIBW_BEFORE_ALL_WINDOWS='C:\\msys64\\usr\\bin\\bash bin/cibw_before_all_windows.sh'
25-
26-
export CIBW_BEFORE_BUILD='pip install numpy cython delvewheel'
27-
export CIBW_BEFORE_BUILD_WINDOWS='C:\\msys64\\usr\\bin\\bash bin/cibw_before_build_windows.sh'
28-
29-
export CIBW_REPAIR_WHEEL_COMMAND_WINDOWS='bin\cibw_repair_wheel_command_windows.bat {dest_dir} {wheel}'
30-
31-
# export CIBW_TEST_COMMAND="python -c 'import flint; print(str(flint.fmpz(2)))'"
32-
export CIBW_TEST_COMMAND="python -m flint.test"
14+
export CIBW_TEST_COMMAND="python -m flint.test" # override setting in pyproject.toml
3315

3416
# cibuildwheel --platform linux
3517
# cibuildwheel --platform windows

pyproject.toml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,30 @@ classifiers = [
2020
[project.readme]
2121
file = "README.md"
2222
content-type = "text/markdown"
23+
24+
[tool.cibuildwheel]
25+
build = "cp39-* cp310-* cp311-* cp312-*"
26+
skip = "*-win32 *-manylinux_i686 *-musllinux_*"
27+
manylinux-x86_64-image = "manylinux2014"
28+
manylinux-i686-image = "manylinux2014"
29+
test-command = "python -c \"import flint; print(str(flint.fmpz(2)))\""
30+
31+
[tool.cibuildwheel.environment]
32+
# bin/build_dependencies_unix.sh places headers and shared libraries under .local
33+
C_INCLUDE_PATH = "$(pwd)/.local/include/"
34+
LIBRARY_PATH = "$(pwd)/.local/lib/"
35+
LD_LIBRARY_PATH = "$(pwd)/.local/lib:$LD_LIBRARY_PATH"
36+
37+
[tool.cibuildwheel.linux]
38+
before-all = "bin/cibw_before_all_linux.sh"
39+
40+
[tool.cibuildwheel.macos]
41+
before-all = "bin/cibw_before_all_macosx_$(uname -m).sh"
42+
43+
[tool.cibuildwheel.windows]
44+
before-all = "C:\\msys64\\usr\\bin\\bash bin/cibw_before_all_windows.sh"
45+
before-build = "pip install delvewheel && C:\\msys64\\usr\\bin\\bash bin/cibw_before_build_windows.sh"
46+
repair-wheel-command = "bin\\cibw_repair_wheel_command_windows.bat {dest_dir} {wheel}"
47+
48+
[tool.cibuildwheel.windows.environment]
49+
PYTHON_FLINT_MINGW64 = "true"

0 commit comments

Comments
 (0)