diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml new file mode 100644 index 00000000..acbd6248 --- /dev/null +++ b/.github/workflows/python.yml @@ -0,0 +1,48 @@ +name: Build + +on: [push, pull_request] + +# doing as cibuildwheel docs says leads to frankenstein arm builds on macos +# so lets be more explicit, no linux arm build as not available on github + +jobs: + build_wheels: + name: Wheel ${{ matrix.python }}-${{ matrix.buildplat[1] }} + runs-on: ${{ matrix.buildplat[0] }} + strategy: + fail-fast: false + matrix: + buildplat: + - [ubuntu-latest, manylinux_x86_64, auto] + - [macos-13, macosx_x86_64, x86_64] + - [macos-14, macosx_arm64, arm64] + python: ["cp38", "cp39", "cp310", "cp311", "cp312"] + + steps: + - uses: actions/checkout@v4 + + - name: Build wheels + uses: pypa/cibuildwheel@v2.20.0 + env: + CIBW_ARCHS: ${{ matrix.buildplat[2] }} + CIBW_BUILD: ${{ matrix.python }}-${{ matrix.buildplat[1] }} + + - uses: actions/upload-artifact@v4 + with: + name: cibw-wheels-${{ matrix.python }}-${{ matrix.buildplat[1] }} + path: ./wheelhouse/*.whl + + + build-sdist: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: '3.10' + - name: Build sdist + run: python setup.py sdist + - uses: actions/upload-artifact@v4 + with: + name: sdist + path: dist diff --git a/setup.py b/setup.py index 6e199da3..80c89543 100644 --- a/setup.py +++ b/setup.py @@ -21,14 +21,14 @@ class LibMM2Build(build_ext): # distributed on PyPI). def run(self): def compile_libminimap2(*args, **kwargs): - cmd = ['make', 'libminimap2.a'] + list(args) + ["python=1"] + cmd = ['make', 'libminimap2.a'] + list(args) subprocess.check_call(cmd) - options = [] + options = ["python=1"] if platform.machine() in ["aarch64", "arm64"]: - options = ["arm_neon=1", "aarch64=1"] + options += ["arm_neon=1", "aarch64=1"] self.execute( compile_libminimap2, options, - 'Compiling libminimap2 using Makefile') + f'Compiling libminimap2 using Makefile with options: {options}') build_ext.run(self)