Skip to content
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

Declare build deps in pyproject.toml #108

Merged
merged 1 commit into from
Jan 25, 2024

Conversation

mkoeppe
Copy link
Contributor

@mkoeppe mkoeppe commented Jan 25, 2024

No description provided.

mkoeppe added a commit to mkoeppe/pyodide that referenced this pull request Jan 25, 2024
@oscarbenjamin
Copy link
Collaborator

Thanks. I had been thinking about doing this for a while but I wasn't sure about all implications given that setup.py uses distutils rather than setuptools (for Python < 3.12). I guess it is fine to call the backend setuptools in any case.

This should fix pip install for the special case that compilers and flint are already installed but a python-flint wheel is not available and should mean that --no-build-isolation is not needed any more.

There is also discussion about pyproject.toml in gh-52. Another thing that would be good to move to pyproject.toml would be all the cibuildwheel config which is currently duplicated in CI config/scripts:

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
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)))"

python-flint/bin/cibw.sh

Lines 12 to 36 in e5da576

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"
# cibuildwheel --platform linux
# cibuildwheel --platform windows
cibuildwheel --platform macos

@oscarbenjamin oscarbenjamin merged commit ea65d5f into flintlib:master Jan 25, 2024
22 checks passed
@oscarbenjamin
Copy link
Collaborator

Thanks Matthias

@mkoeppe mkoeppe deleted the pyproject_toml branch January 25, 2024 18:26
@mkoeppe
Copy link
Contributor Author

mkoeppe commented Jan 25, 2024

--no-build-isolation is not needed any more

#111 updates the README accordingly

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants