From 6c29fc2a095183e3c076dc621590780111eb15fc Mon Sep 17 00:00:00 2001 From: Chris Wright Date: Tue, 16 Jan 2024 16:59:25 +0000 Subject: [PATCH 1/6] Stub out github action for python wheels --- .github/workflows/wheels.yml | 76 ++++++++++++++++++++++++++++++++++++ 1 file changed, 76 insertions(+) create mode 100644 .github/workflows/wheels.yml diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml new file mode 100644 index 0000000..2971a7a --- /dev/null +++ b/.github/workflows/wheels.yml @@ -0,0 +1,76 @@ +name: Build and upload to PyPI + +# Build on every branch push, tag push, and pull request change: +on: [push, pull_request] +# Alternatively, to publish when a (published) GitHub Release is created, use the following: +# on: +# push: +# pull_request: +# release: +# types: +# - published +env: + CIBW_BUILD_VERBOSITY: 3 + #CIBW_TEST_COMMAND: python -m unittest discover {project}/tests + # Disable building PyPy wheels on all platforms + CIBW_SKIP: pp* + +jobs: + build_wheels: + name: Build wheels for ${{ matrix.python }}-${{ matrix.buildplat[1] }} + runs-on: ${{ matrix.buildplat[0] }} + strategy: + # Ensure that a wheel builder finishes even if another fails + fail-fast: false + matrix: + buildplat: + - [ubuntu-latest, manylinux_x86_64, auto] + - [macos-latest, macosx_x86_64, x86_64] + - [macos-latest, macosx_arm64, arm64] + python: ["cp38", "cp39", "cp310", "cp311", "cp312"] + + steps: + - uses: actions/checkout@v3 + + - name: Build wheels + uses: pypa/cibuildwheel@v2.15.0 + env: + CIBW_ARCHS: ${{ matrix.buildplat[2] }} + CIBW_BUILD: ${{ matrix.python }}-${{ matrix.buildplat[1] }} + + - uses: actions/upload-artifact@v3 + with: + path: ./wheelhouse/*.whl + + build_sdist: + name: Build source distribution + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: Build sdist + run: pipx run build --sdist + + - uses: actions/upload-artifact@v3 + with: + path: dist/*.tar.gz + + upload_pypi: + needs: [build_wheels, build_sdist] + runs-on: ubuntu-latest + # upload to PyPI on every tag starting with 'v' + if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') + # alternatively, to publish when a GitHub Release is created, use the following rule: + # if: github.event_name == 'release' && github.event.action == 'published' + steps: + - uses: actions/download-artifact@v3 + with: + # unpacks default artifact into dist/ + # if `name: artifact` is omitted, the action will create extra parent dir + name: artifact + path: dist + + - uses: pypa/gh-action-pypi-publish@v1.5.0 + with: + user: __token__ + password: ${{ secrets.pypi_password }} From 5e80eb3f9b72ee42bb829e88dda1335e90352944 Mon Sep 17 00:00:00 2001 From: Chris Wright Date: Tue, 16 Jan 2024 17:09:24 +0000 Subject: [PATCH 2/6] checkout submodules in actions --- .github/workflows/wheels.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index 2971a7a..a8bf564 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -31,6 +31,8 @@ jobs: steps: - uses: actions/checkout@v3 + with: + submodules: 'true' - name: Build wheels uses: pypa/cibuildwheel@v2.15.0 @@ -47,6 +49,8 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 + with: + submodules: 'true' - name: Build sdist run: pipx run build --sdist From 2cac60cc8e7507e904b37ac5a35be8c09e8231ed Mon Sep 17 00:00:00 2001 From: Chris Wright Date: Tue, 16 Jan 2024 17:21:51 +0000 Subject: [PATCH 3/6] Pin cython cos reasons --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 52c0e7e..a54f54d 100644 --- a/setup.py +++ b/setup.py @@ -66,7 +66,7 @@ author_email = "gaoy1@chop.edu", license = "MIT", keywords = "multiple-sequence-alignment partial-order-graph-alignment", - setup_requires=["cython"], + setup_requires=["cython<3"], # see https://github.com/cython/cython/issues/5568 # Build instructions ext_modules = [ Extension( From 23dc7b1cffd6bc47ce9e2af437819a5aa40f29ab Mon Sep 17 00:00:00 2001 From: Chris Wright Date: Tue, 16 Jan 2024 17:34:22 +0000 Subject: [PATCH 4/6] Skip one mac build --- .github/workflows/wheels.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index a8bf564..9dd88a8 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -28,6 +28,10 @@ jobs: - [macos-latest, macosx_x86_64, x86_64] - [macos-latest, macosx_arm64, arm64] python: ["cp38", "cp39", "cp310", "cp311", "cp312"] + exclude: + # This one fails, I (cjw85) don't care for why + - buildplat: macosx_arm64 + - python: "cp38" steps: - uses: actions/checkout@v3 From b99dd31f1c9f9631f827164b6dcb93e5a5658694 Mon Sep 17 00:00:00 2001 From: Chris Wright Date: Tue, 16 Jan 2024 17:44:13 +0000 Subject: [PATCH 5/6] Dont skip mac build --- .github/workflows/wheels.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index 9dd88a8..362faf3 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -28,10 +28,10 @@ jobs: - [macos-latest, macosx_x86_64, x86_64] - [macos-latest, macosx_arm64, arm64] python: ["cp38", "cp39", "cp310", "cp311", "cp312"] - exclude: - # This one fails, I (cjw85) don't care for why - - buildplat: macosx_arm64 - - python: "cp38" + #exclude: + # # This one fails, I (cjw85) don't care for why + # - buildplat: macosx_arm64 + # - python: "cp38" steps: - uses: actions/checkout@v3 From 6ad7362645f631c8b2391f786d541c67c566c297 Mon Sep 17 00:00:00 2001 From: Chris Wright Date: Tue, 16 Jan 2024 17:57:06 +0000 Subject: [PATCH 6/6] Dont do mac arm for now --- .github/workflows/wheels.yml | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index 362faf3..5b68e3a 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -26,12 +26,9 @@ jobs: buildplat: - [ubuntu-latest, manylinux_x86_64, auto] - [macos-latest, macosx_x86_64, x86_64] - - [macos-latest, macosx_arm64, arm64] + # skip these for now, need more work + #- [macos-latest, macosx_arm64, arm64] python: ["cp38", "cp39", "cp310", "cp311", "cp312"] - #exclude: - # # This one fails, I (cjw85) don't care for why - # - buildplat: macosx_arm64 - # - python: "cp38" steps: - uses: actions/checkout@v3