Skip to content

Commit

Permalink
Adapt build to new cibuildwheel and other upstream changes (#314)
Browse files Browse the repository at this point in the history
Fixes builds using the latest cibuildwheel. Due to incompatible changes introduced upstream pypy(pypa/distutils#283) had to be taken out for now.
  • Loading branch information
hendrikmuhs authored Nov 6, 2024
1 parent f6b081a commit 1223704
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 24 deletions.
22 changes: 12 additions & 10 deletions .github/workflows/python-cibuildwheel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,20 @@ jobs:
os: [ubuntu-22.04, macos-13]
# separate archs, so they use individual caches
arch: [ 'x86_64', 'arm64' ]
flavor: ['cpython', 'pypy']
# skip pypy, https://github.com/pypa/distutils/issues/283
flavor: ['cpython']
# separate musl and many on linux, for mac we just skip one of those
target: [ 'many', 'musl' ]
exclude:
- os: macos-13
target: musl
- os: ubuntu-22.04
target: musl
flavor: pypy
- os: macos-13
arch: arm64
flavor: pypy
# skip pypy, https://github.com/pypa/distutils/issues/283
#- os: ubuntu-22.04
# target: musl
# flavor: pypy
#- os: macos-13
# arch: arm64
# flavor: pypy
steps:
- uses: actions/checkout@v4
- name: Set up QEMU
Expand Down Expand Up @@ -84,6 +86,7 @@ jobs:
- name: install mac dependencies X86_64
if: ${{ (runner.os == 'macOS') && (matrix.arch == 'x86_64') }}
run: |
echo "MACOSX_DEPLOYMENT_TARGET=13.0" >> $GITHUB_ENV && \
brew update && \
brew install zlib snappy boost
Expand All @@ -109,11 +112,10 @@ jobs:
ls /Users/runner/work/keyvi/keyvi/arm64-homebrew
- name: Build python wheels for ${{ matrix.os }} on ${{ matrix.arch }}
uses: pypa/cibuildwheel@v2.17.0
uses: pypa/cibuildwheel@v2.21.3
env:
# Skip CPython 3.6 and CPython 3.7
# skip pypy 3.8, https://github.com/pypa/distutils/issues/283
CIBW_SKIP: ${{ env.CIBW_SKIP }} cp36-* cp37-* pp38*
CIBW_SKIP: ${{ env.CIBW_SKIP }} cp36-* cp37-*

# skip testing all python versions on linux arm, only test 3.12
# skip tests on pypy, currently fails for indexer tests
Expand Down
2 changes: 2 additions & 0 deletions python/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[build-system]
requires = ["autowrap>=0.16.0", "msgpack>=1.0.0", "pytest>=7.1.1", "cython>=3.0"]
15 changes: 1 addition & 14 deletions python/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -327,18 +327,6 @@ def run(self):
clean_pykeyvi_build_directory()
_clean.clean.run(self)

have_wheel = False
try:
import wheel.bdist_wheel as _bdist_wheel

class bdist_wheel(custom_opts, _bdist_wheel.bdist_wheel):
parent = _bdist_wheel.bdist_wheel
user_options = _bdist_wheel.bdist_wheel.user_options + custom_user_options

have_wheel = True
except:
None

class build_cxx(_build_ext.build_ext):
description = "customized for keyvi: " + _build_ext.build_ext.description

Expand Down Expand Up @@ -388,8 +376,7 @@ class build_ext(custom_opts, build_cxx):
"bdist": bdist,
"clean": clean,
}
if have_wheel:
commands["bdist_wheel"] = bdist_wheel

for e in ext_modules:
e.cython_directives = {"embedsignature": True}

Expand Down

0 comments on commit 1223704

Please sign in to comment.