Skip to content

pyproject.toml: Move settings of CIBW_* here #123

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 12 commits into from
Feb 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 2 additions & 16 deletions .github/workflows/buildwheel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,23 +34,9 @@ jobs:
- name: Build wheels
uses: pypa/[email protected]
env:
CIBW_BUILD: cp39-* cp310-* cp311-* cp312-*
CIBW_SKIP: "*-win32 *-manylinux_i686 *-musllinux_*"
CIBW_MANYLINUX_X86_64_IMAGE: manylinux2014
CIBW_MANYLINUX_I686_IMAGE: manylinux2014
CIBW_BEFORE_ALL_LINUX: bin/cibw_before_all_linux.sh
CIBW_BEFORE_ALL_MACOS: bin/cibw_before_all_macosx_x86_64.sh
# override setting in pyproject.toml to use msys2 instead of msys64 bash
CIBW_BEFORE_ALL_WINDOWS: msys2 -c bin/cibw_before_all_windows.sh
CIBW_BEFORE_BUILD_WINDOWS: msys2 -c bin/cibw_before_build_windows.sh
CIBW_BEFORE_BUILD: pip install numpy setuptools cython delvewheel
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
CIBW_REPAIR_WHEEL_COMMAND_WINDOWS: >-
bin\cibw_repair_wheel_command_windows.bat {dest_dir} {wheel}
CIBW_TEST_COMMAND: python -c "import flint; print(str(flint.fmpz(2)))"
CIBW_BEFORE_BUILD_WINDOWS: pip install delvewheel && msys2 -c bin/cibw_before_build_windows.sh

- uses: actions/upload-artifact@v4
with:
Expand Down
12 changes: 6 additions & 6 deletions bin/build_dependencies_unix.sh
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ if [ $USE_GMP = "gmp" ]; then
--enable-shared=yes\
--enable-static=no\
--host=$HOST_ARG
make -j3
make -j6
make install

cd ..
Expand All @@ -195,7 +195,7 @@ else
tar xf yasm-$YASMVER.tar.gz
cd yasm-$YASMVER
./configure --prefix=$PREFIX
make -j3
make -j6
make install
cd ..

Expand Down Expand Up @@ -226,7 +226,7 @@ else
--enable-shared=yes\
--enable-static=no\
--enable-gmpcompat
make -j3
make -j6
make install
cd ..

Expand Down Expand Up @@ -260,7 +260,7 @@ else
--with-gmp=$PREFIX\
--enable-shared=yes\
--enable-static=no
make -j3
make -j6
make install
cd ..
fi
Expand All @@ -285,7 +285,7 @@ cd flint-$FLINTVER
$FLINTARB_WITHGMP\
--with-mpfr=$PREFIX\
--disable-static
make -j3
make -j6
make install
cd ..

Expand All @@ -312,7 +312,7 @@ if [ $BUILD_ARB = "yes" ]; then
$FLINTARB_WITHGMP\
--with-mpfr=$PREFIX\
--disable-static
make -j3
make -j6
make install
#
# Set PATH so that DLLs are picked up on Windows.
Expand Down
7 changes: 1 addition & 6 deletions bin/cibw.bat
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,7 @@ rem wheels from a previous run so we delete them here.
rem
del /q wheelhouse\*

rem override setting in pyproject.toml
set CIBW_BUILD=cp39-* cp310-* cp311-*
set CIBW_SKIP=*-win32 *-manylinux_i686 *-musllinux_*
set CIBW_BEFORE_ALL_WINDOWS=C:\msys64\usr\bin\bash bin/cibw_before_all_windows.sh
set CIBW_BEFORE_BUILD_WINDOWS=C:\msys64\usr\bin\bash bin/cibw_before_build_windows.sh
set CIBW_ENVIRONMENT=PYTHON_FLINT_MINGW64=true
set CIBW_REPAIR_WHEEL_COMMAND_WINDOWS=bin\cibw_repair_wheel_command_windows.bat {dest_dir} {wheel}
set CIBW_TEST_COMMAND=python -c "import flint; print(str(flint.fmpz(2)))"

cibuildwheel --platform windows
20 changes: 1 addition & 19 deletions bin/cibw.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,28 +8,10 @@

rm -f wheelhouse/*

# bin/build_dependencies_unix.sh places headers and shared libraries under .local
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'

export CIBW_BUILD='cp39-* cp310-* cp311-* cp312-*'
# export CIBW_BUILD='cp311-*'
export CIBW_SKIP='*-win32 *-manylinux_i686 *-musllinux_*'

# export CIBW_ARCHS_MACOS="x86_64"
export CIBW_ARCHS_MACOS="arm64"

export CIBW_BEFORE_ALL_LINUX=bin/cibw_before_all_linux.sh
# export CIBW_BEFORE_ALL_MACOS=bin/cibw_before_all_macosx_x86_64.sh
export CIBW_BEFORE_ALL_MACOS=bin/cibw_before_all_macosx_arm64.sh
export CIBW_BEFORE_ALL_WINDOWS='C:\\msys64\\usr\\bin\\bash bin/cibw_before_all_windows.sh'

export CIBW_BEFORE_BUILD='pip install numpy cython delvewheel'
export CIBW_BEFORE_BUILD_WINDOWS='C:\\msys64\\usr\\bin\\bash bin/cibw_before_build_windows.sh'

export CIBW_REPAIR_WHEEL_COMMAND_WINDOWS='bin\cibw_repair_wheel_command_windows.bat {dest_dir} {wheel}'

# export CIBW_TEST_COMMAND="python -c 'import flint; print(str(flint.fmpz(2)))'"
export CIBW_TEST_COMMAND="python -m flint.test"
export CIBW_TEST_COMMAND="python -m flint.test" # override setting in pyproject.toml

# cibuildwheel --platform linux
# cibuildwheel --platform windows
Expand Down
27 changes: 27 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,30 @@ classifiers = [
[project.readme]
file = "README.md"
content-type = "text/markdown"

[tool.cibuildwheel]
build = "cp39-* cp310-* cp311-* cp312-*"
skip = "*-win32 *-manylinux_i686 *-musllinux_*"
manylinux-x86_64-image = "manylinux2014"
manylinux-i686-image = "manylinux2014"
test-command = "python -c \"import flint; print(str(flint.fmpz(2)))\""

[tool.cibuildwheel.environment]
# bin/build_dependencies_unix.sh places headers and shared libraries under .local
C_INCLUDE_PATH = "$(pwd)/.local/include/"
LIBRARY_PATH = "$(pwd)/.local/lib/"
LD_LIBRARY_PATH = "$(pwd)/.local/lib:$LD_LIBRARY_PATH"

[tool.cibuildwheel.linux]
before-all = "bin/cibw_before_all_linux.sh"

[tool.cibuildwheel.macos]
before-all = "bin/cibw_before_all_macosx_$(uname -m).sh"

[tool.cibuildwheel.windows]
before-all = "C:\\msys64\\usr\\bin\\bash bin/cibw_before_all_windows.sh"
before-build = "pip install delvewheel && C:\\msys64\\usr\\bin\\bash bin/cibw_before_build_windows.sh"
repair-wheel-command = "bin\\cibw_repair_wheel_command_windows.bat {dest_dir} {wheel}"

[tool.cibuildwheel.windows.environment]
PYTHON_FLINT_MINGW64 = "true"