Skip to content

Commit

Permalink
Bump cibuildwheel and fix macos build (#6)
Browse files Browse the repository at this point in the history
* Bump cibuildwheel and fix macos build

* limit numpy to 2.0 (temp)
  • Loading branch information
akaszynski authored Jul 16, 2024
1 parent 3b68c1b commit 07dcca0
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 27 deletions.
51 changes: 28 additions & 23 deletions .github/workflows/build-and-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,25 +18,26 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
os: [ubuntu-latest, windows-latest, macos-14, macos-13]

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
submodules: true

- name: Build wheels
uses: pypa/cibuildwheel@v2.16.2
uses: pypa/cibuildwheel@v2.19.2

- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: pyminiply-wheels-${{ matrix.os }}
path: ./wheelhouse/*.whl

build_sdist:
name: Build source distribution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
submodules: true

Expand All @@ -52,33 +53,37 @@ jobs:
run: |
pip install dist/*
pip install pytest pyvista
pytest -x
pytest
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: pyminiply-sdist
path: dist/*.tar.gz

upload_pypi:
needs: [build_wheels, build_sdist]
runs-on: ubuntu-latest
# upload to PyPI on every tag
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
# 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:
name: artifact
path: dist
- uses: actions/download-artifact@v4
- name: Flatten directory structure
run: |
mkdir -p dist/
find . -name '*.whl' -exec mv {} dist/ \;
find . -name '*.tar.gz' -exec mv {} dist/ \;
- uses: pypa/[email protected]
with:
user: __token__
password: ${{ secrets.PYPI_TOKEN }}
- name: List artifacts
run: ls -R

- name: Release
uses: softprops/action-gh-release@v1
with:
generate_release_notes: true
files: |
./dist/*.whl
- uses: pypa/[email protected]
with:
user: __token__
password: ${{ secrets.PYPI_TOKEN }}

- name: Release
uses: softprops/action-gh-release@v2
with:
generate_release_notes: true
files: |
./dist/*.whl
7 changes: 4 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,10 @@ test-requires = "pytest pyvista"
test-command = "pytest {project}/tests"

[tool.cibuildwheel.macos]
# https://cibuildwheel.readthedocs.io/en/stable/faq/#apple-silicon
archs = ["x86_64", "universal2"]
test-skip = ["*_arm64", "*_universal2:arm64"]
archs = ["native"]

[tool.cibuildwheel.macos.environment]
MACOSX_DEPLOYMENT_TARGET = "10.14" # Needed for full C++17 support on MacOS

[tool.codespell]
skip = '*.cxx,*.h,*.gif,*.png,*.jpg,*.js,*.html,*.doctree,*.ttf,*.woff,*.woff2,*.eot,*.mp4,*.inv,*.pickle,*.ipynb,flycheck*,./.git/*,./.hypothesis/*,*.yml,./doc/build/*,./doc/images/*,./dist/*,*~,.hypothesis*,*.cpp,*.c'
Expand Down
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Setup for pyminiply."""

from io import open as io_open
import os
import sys
Expand Down Expand Up @@ -80,5 +81,5 @@
"pyminiply/wrapper": ["*.c", "*.h"],
},
keywords="read ply",
install_requires=["numpy>1.11.0"],
install_requires=["numpy>1.11.0,<2.0"],
)

0 comments on commit 07dcca0

Please sign in to comment.