Skip to content

Commit c38e52e

Browse files
committed
Add github actions for python wheels and sdist
1 parent 7f241a4 commit c38e52e

File tree

2 files changed

+52
-4
lines changed

2 files changed

+52
-4
lines changed

.github/workflows/python.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: Build
2+
3+
on: [push, pull_request]
4+
5+
# doing as cibuildwheel docs says leads to frankenstein arm builds on macos
6+
# so lets be more explicit, no linux arm build as not available on github
7+
8+
jobs:
9+
build_wheels:
10+
name: Wheel ${{ matrix.python }}-${{ matrix.buildplat[1] }}
11+
runs-on: ${{ matrix.buildplat[0] }}
12+
strategy:
13+
fail-fast: false
14+
matrix:
15+
buildplat:
16+
- [ubuntu-latest, manylinux_x86_64, auto]
17+
- [macos-13, macosx_x86_64, x86_64]
18+
- [macos-14, macosx_arm64, arm64]
19+
python: ["cp38", "cp39", "cp310", "cp311", "cp312"]
20+
21+
steps:
22+
- uses: actions/checkout@v4
23+
24+
- name: Build wheels
25+
uses: pypa/[email protected]
26+
env:
27+
CIBW_ARCHS: ${{ matrix.buildplat[2] }}
28+
CIBW_BUILD: ${{ matrix.python }}-${{ matrix.buildplat[1] }}
29+
30+
- uses: actions/upload-artifact@v4
31+
with:
32+
name: cibw-wheels-${{ matrix.python }}-${{ matrix.buildplat[1] }}
33+
path: ./wheelhouse/*.whl
34+
35+
36+
build-sdist:
37+
runs-on: ubuntu-latest
38+
steps:
39+
- uses: actions/checkout@v4
40+
- uses: actions/setup-python@v5
41+
with:
42+
python-version: '3.10'
43+
- name: Build sdist
44+
run: python setup.py sdist
45+
- uses: actions/upload-artifact@v4
46+
with:
47+
name: sdist
48+
path: dist

setup.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,14 @@ class LibMM2Build(build_ext):
2121
# distributed on PyPI).
2222
def run(self):
2323
def compile_libminimap2(*args, **kwargs):
24-
cmd = ['make', 'libminimap2.a'] + list(args) + ["python=1"]
24+
cmd = ['make', 'libminimap2.a'] + list(args)
2525
subprocess.check_call(cmd)
26-
options = []
26+
options = ["python=1"]
2727
if platform.machine() in ["aarch64", "arm64"]:
28-
options = ["arm_neon=1", "aarch64=1"]
28+
options += ["arm_neon=1", "aarch64=1"]
2929
self.execute(
3030
compile_libminimap2, options,
31-
'Compiling libminimap2 using Makefile')
31+
f'Compiling libminimap2 using Makefile with options: {options}')
3232
build_ext.run(self)
3333

3434

0 commit comments

Comments
 (0)