Skip to content

Commit

Permalink
Merge pull request #2 from JoeZiminski/add_cibuildwheels
Browse files Browse the repository at this point in the history
Add cibuildwheels
  • Loading branch information
magland authored Sep 22, 2023
2 parents 4b9e7f8 + 0bb373a commit e557f3c
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 2 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/build_wheels.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: build wheels

on: [push, pull_request]

jobs:
build_wheels:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
env:
CFLAGS: "-std=c++11"
CIBW_TEST_REQUIRES: pytest
CIBW_TEST_COMMAND: cd {package} && ls
strategy:
matrix:
os: [ubuntu-20.04, windows-2019, macos-11]

steps:
- uses: actions/checkout@v4

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

- uses: actions/upload-artifact@v3
with:
path: ./wheelhouse/*.whl
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
test*

# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
Expand Down
Empty file added isosplit6/tests/__init__.py
Empty file.
14 changes: 14 additions & 0 deletions isosplit6/tests/test_simple_run.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
from isosplit6 import isosplit6
import numpy as np
from numpy.typing import NDArray

def test_isosplit6_runs():
"""
A simple test to check that isosplit6 runs.
Useful for testing wheels are successfully built.
"""
data = np.random.random((100, 100))

result = isosplit6(data)

assert isinstance(result, np.ndarray)
13 changes: 13 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@ requires = [
]
build-backend = "setuptools.build_meta"

[pyproject.optional-dependencies]
dev = [
"numpy", # required for tests
"pytest",
"ruff",
]

[tool.ruff]
extend-select = [
"B", # flake8-bugbear
Expand All @@ -17,3 +24,9 @@ extend-ignore = [
"E501", # Line too long
]
target-version = "py37"

[tool.cibuildwheel]
build = "cp37-* cp38-* cp39-* cp310-* cp311-*"

[tool.cibuildwheel.macos]
archs = ["x86_64", "arm64"]

0 comments on commit e557f3c

Please sign in to comment.