Skip to content

Commit 849a593

Browse files
committed
Update Github work flow
1 parent d26c6e5 commit 849a593

File tree

3 files changed

+52
-16
lines changed

3 files changed

+52
-16
lines changed

.github/workflows/wheels.yml

Lines changed: 38 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -16,34 +16,59 @@ on:
1616

1717
jobs:
1818
build_wheels:
19-
name: ${{ matrix.type }} ${{ matrix.arch }} on ${{ matrix.os }}
19+
name: Build wheels on ${{ matrix.os }} for ${{ matrix.arch }} - ${{ matrix.p_ver }}
2020
runs-on: ${{ matrix.os }}
21+
env:
22+
CIBW_BUILD: ${{ matrix.cibw_build }}
23+
CIBW_ARCHS_LINUX: ${{ matrix.arch }}
24+
CIBW_ARCHS_MACOS: ${{ matrix.arch }}
2125
strategy:
22-
fail-fast: false
2326
matrix:
24-
os: [macos-latest, ubuntu-latest]
27+
os: [ubuntu-latest, windows-latest, macos-latest]
2528
arch: [auto64]
29+
cibw_build: ["cp3{9,10,11}-*"]
30+
p_ver: ["3.9-3.11"]
31+
exclude:
32+
- arch: arm64
33+
os: macos-latest
34+
include:
35+
- arch: aarch64
36+
os: ubuntu-latest
37+
cibw_build: "cp37*"
38+
p_ver: "3.7"
39+
- arch: aarch64
40+
os: ubuntu-latest
41+
cibw_build: "cp38*"
42+
p_ver: "3.8"
43+
- arch: aarch64
44+
os: ubuntu-latest
45+
cibw_build: "cp39*"
46+
p_ver: "3.9"
47+
- arch: aarch64
48+
os: ubuntu-latest
49+
cibw_build: "cp310*"
50+
p_ver: "3.10"
51+
- arch: aarch64
52+
os: ubuntu-latest
53+
cibw_build: "cp311*"
54+
p_ver: "3.11"
2655

2756
steps:
2857
- uses: actions/checkout@v3
2958
with:
3059
fetch-depth: 0
3160
submodules: true
3261

33-
# Used to host cibuildwheel
34-
- uses: actions/setup-python@v3
35-
# Installs poetry
36-
- uses: Gr1N/setup-poetry@v8
62+
- name: Set up QEMU
63+
if: matrix.os == 'ubuntu-latest' && matrix.arch == 'aarch64'
64+
uses: docker/setup-qemu-action@v1
3765
with:
38-
poetry-version: "1.4.0"
39-
- name: Install cibuildwheel
40-
run: python -m pip install cibuildwheel==2.12.1
66+
platforms: arm64
4167

4268
- name: Build wheels
43-
run: python -m cibuildwheel --output-dir wheelhouse
69+
uses: pypa/cibuildwheel@v2.12.1
4470
env:
45-
CIBW_ARCHS_MACOS: "x86_64 universal2 arm64"
46-
CIBW_TEST_SKIP: '*_arm64 *_universal2:arm64'
71+
CIBW_ARCHS_MACOS: "x86_64"
4772

4873
- uses: actions/upload-artifact@v3
4974
with:

build.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import os
12
from setuptools_cpp import CMakeExtension, ExtensionBuilder
23
from typing import Any, Dict
34

@@ -12,5 +13,13 @@ def build(setup_kwargs: Dict[str, Any]) -> None:
1213
"ext_modules": ext_modules,
1314
"cmdclass": dict(build_ext=ExtensionBuilder),
1415
"zip_safe": False,
16+
"options": {
17+
'bdist_wheel': {
18+
'plat_name': os.getenv('PP_PYTHON_TARGET', 'any')
19+
},
20+
'egg_info': {
21+
'egg_base': './build/'
22+
}
23+
}
1524
}
1625
)

pyproject.toml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,11 @@ llamacpp-cli = 'llamacpp.cli:run'
3333
llamacpp-chat = 'llamacpp.chat:run'
3434

3535
[tool.cibuildwheel]
36+
# Install pybind and poetry
37+
before-build = "pip install -U \"pybind11[global]\" poetry"
3638

37-
# Install something required for the build
38-
# (you might want to use build-system.requires instead)
39-
before-build = "pip install -U \"pybind11[global]\""
4039
# Skip PyPy and 32-bit builds
4140
skip = ["pp*", "*-win32", "*-manylinux_i686", "*-musllinux_i686"]
41+
42+
build-verbosity = 3
43+
test-skip = "*macosx*arm64*"

0 commit comments

Comments
 (0)