Skip to content

Commit

Permalink
Move cibw config to pyproject.toml
Browse files Browse the repository at this point in the history
  • Loading branch information
emlowe committed Aug 9, 2023
1 parent bcc36af commit 0c963c9
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 46 deletions.
46 changes: 0 additions & 46 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -122,56 +122,10 @@ jobs:
- name: Build and test
env:
CIBW_BUILD_VERBOSITY_MACOS: 0
CIBW_BUILD_VERBOSITY_LINUX: 0
CIBW_BUILD_VERBOSITY_WINDOWS: 0
CIBW_BUILD: ${{ matrix.python.cibw-build }}
CIBW_SKIP: '*-manylinux_i686 *-win32 *-musllinux_*'
CIBW_MANYLINUX_AARCH64_IMAGE: ${{ matrix.python.manylinux['arm'] }}
CIBW_MANYLINUX_X86_64_IMAGE: ${{ matrix.python.manylinux['intel'] }}
CIBW_ENVIRONMENT_LINUX: "PATH=/project/cmake-3.17.3-Linux-`uname -m`/bin:$PATH BUILD_VDF_CLIENT=N"
CIBW_BEFORE_ALL_LINUX: >
yum -y install epel-release
&& echo "epel-release installed"
&& yum -y install boost-devel lzip
&& echo "boost-devel and lzip installed"
&& curl -L https://github.com/Kitware/CMake/releases/download/v3.17.3/cmake-3.17.3-Linux-`uname -m`.sh > cmake.sh
&& yes | sh cmake.sh | cat
&& rm -f /usr/bin/cmake
&& curl -L https://ftp.gnu.org/gnu/gmp/gmp-6.2.1.tar.lz | tar x --lzip
&& cp src/lib/gmp-patch-6.2.1/longlong.h gmp-6.2.1/
&& cp src/lib/gmp-patch-6.2.1/compat.c gmp-6.2.1/
&& cp src/lib/gmp-patch-6.2.1/mpz/inp_raw.c gmp-6.2.1/mpz
&& cd gmp-6.2.1 && ./configure --enable-fat --enable-cxx
&& make && make install && cd .. && rm -rf gmp-6.2.1
&& cmake --version
&& uname -a
CIBW_BEFORE_BUILD_LINUX: >
python -m pip install --upgrade pip
CIBW_ARCHS_MACOS: ${{ matrix.os.cibw-archs-macos[matrix.arch.matrix] }}
CIBW_BEFORE_ALL_MACOS: >
brew install gmp boost cmake
CIBW_BEFORE_BUILD_MACOS: >
python -m pip install --upgrade pip
CIBW_ENVIRONMENT_MACOS: "MACOSX_DEPLOYMENT_TARGET=10.14 BUILD_VDF_CLIENT=N"
CIBW_BEFORE_ALL_WINDOWS: >
git clone https://github.com/Chia-Network/mpir_gc_x64.git
CIBW_ENVIRONMENT_WINDOWS: "BUILD_VDF_CLIENT=N SETUPTOOLS_USE_DISTUTILS=stdlib"
CIBW_REPAIR_WHEEL_COMMAND_WINDOWS: >
ls -l mpir_gc_x64 && pip uninstall -y delocate
&& pip install git+https://github.com/Chia-Network/delocate.git
&& delocate-wheel -v -i mpir_gc_x64/mpir.dll {wheel}
&& delocate-wheel -v -i mpir_gc_x64/mpir_gc.dll {wheel}
&& delocate-wheel -v -i mpir_gc_x64/mpir_broadwell.dll {wheel}
&& delocate-wheel -v -i mpir_gc_x64/mpir_broadwell_avx.dll {wheel}
&& delocate-wheel -v -i mpir_gc_x64/mpir_bulldozer.dll {wheel}
&& delocate-wheel -v -i mpir_gc_x64/mpir_haswell.dll {wheel}
&& delocate-wheel -v -i mpir_gc_x64/mpir_piledriver.dll {wheel}
&& delocate-wheel -v -i mpir_gc_x64/mpir_sandybridge.dll {wheel}
&& delocate-wheel -v -i mpir_gc_x64/mpir_skylake_avx.dll {wheel}
&& cp {wheel} {dest_dir}
CIBW_TEST_REQUIRES: pytest
CIBW_TEST_COMMAND: py.test -v {project}/tests
CIBW_PRERELEASE_PYTHONS: True
run:
pipx run --spec='cibuildwheel==2.11.1' cibuildwheel --output-dir dist 2>&1
Expand Down
44 changes: 44 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,47 @@ build-backend = "setuptools.build_meta"
[tool.setuptools_scm]
fallback_version = "unknown-no-.git-directory"
local_scheme = "no-local-version"

[tool.cibuildwheel]
test-requires = "pytest"
test-command = "pytest -v {project}/tests"
skip = "*-manylinux_i686 *-win32 *-musllinux_*"

[tool.cibuildwheel.linux]
build-verbosity = 0
before-all = """
curl -L https://ftp.gnu.org/gnu/gmp/gmp-6.2.1.tar.lz | tar x --lzip \
&& cp src/lib/gmp-patch-6.2.1/longlong.h gmp-6.2.1/ \
&& cp src/lib/gmp-patch-6.2.1/compat.c gmp-6.2.1/ \
&& cp src/lib/gmp-patch-6.2.1/mpz/inp_raw.c gmp-6.2.1/mpz \
&& cd gmp-6.2.1 && ./configure --enable-fat --enable-cxx \
&& make && make install && cd .. && rm -rf gmp-6.2.1 \
&& cmake --version \
&& uname -a
"""
before-build = "python -m pip install --upgrade pip"

[tool.cibuildwheel.macos]
build-verbosity = 0
before-all = "brew install gmp boost cmake"
before-build = "python -m pip install --upgrade pip"
environment = {MACOSX_DEPLOYMENT_TARGET="11", SYSTEM_VERSION_COMPAT=0, BUILD_VDF_CLIENT="N"}

[tool.cibuildwheel.windows]
build-verbosity = 0
before-all = "git clone https://github.com/Chia-Network/mpir_gc_x64.git"
environment = {BUILD_VDF_CLIENT="N", SETUPTOOLS_USE_DISTUTILS="stdlib"}
repair-wheel-command = """
ls -l mpir_gc_x64 && pip uninstall -y delocate \
&& pip install git+https://github.com/Chia-Network/delocate.git \
&& delocate-wheel -v -i mpir_gc_x64/mpir.dll {wheel} \
&& delocate-wheel -v -i mpir_gc_x64/mpir_gc.dll {wheel} \
&& delocate-wheel -v -i mpir_gc_x64/mpir_broadwell.dll {wheel} \
&& delocate-wheel -v -i mpir_gc_x64/mpir_broadwell_avx.dll {wheel} \
&& delocate-wheel -v -i mpir_gc_x64/mpir_bulldozer.dll {wheel} \
&& delocate-wheel -v -i mpir_gc_x64/mpir_haswell.dll {wheel} \
&& delocate-wheel -v -i mpir_gc_x64/mpir_piledriver.dll {wheel} \
&& delocate-wheel -v -i mpir_gc_x64/mpir_sandybridge.dll {wheel} \
&& delocate-wheel -v -i mpir_gc_x64/mpir_skylake_avx.dll {wheel} \
&& cp {wheel} {dest_dir}
"""

0 comments on commit 0c963c9

Please sign in to comment.