Skip to content

Commit

Permalink
Use cibuildwheel.
Browse files Browse the repository at this point in the history
  • Loading branch information
esoma committed Jul 8, 2024
1 parent 203a7b8 commit 505bdd8
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 11 deletions.
14 changes: 8 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
os: [ubuntu-latest, windows-latest, macos-13, macos-14]
python-version: ['3.12']
python-arch: [x64]

Expand All @@ -33,22 +33,24 @@ jobs:
python-version: ${{ matrix.python-version }}
architecture: ${{ matrix.python-arch }}

- name: Install Poetry
uses: snok/install-poetry@v1
- name: Set up QEMU
if: runner.os == 'Linux'
uses: docker/setup-qemu-action@v3
with:
platforms: all

- name: Initialize Submodules
run: |
git submodule update --init --recursive
- name: Build
run: |
poetry build
uses: pypa/[email protected]

- name: Upload Github Release Artifact
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ./dist/*.whl
file: ./wheelhouse/*.whl
file_glob: true
tag: ${{ github.ref }}

Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@
*.pyd
*.egg-info
build/
dist/
dist/
wheelhouse/
9 changes: 6 additions & 3 deletions build.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@

__all__ = ()

# codegen
from codegen import generate_math_files
try:
# codegen
from codegen import generate_math_files
except ImportError:
generate_math_files = None # type: ignore

# python
import os
Expand Down Expand Up @@ -48,7 +51,7 @@


def _build() -> None:
if os.environ.get("EMATH_GENERATE_MATH_FILES", "0") == "1":
if os.environ.get("EMATH_GENERATE_MATH_FILES", "0") == "1" and generate_math_files is not None:
generate_math_files(Path("src/emath"), Path("include"), Path("doc/source"))

cmd = build_ext(Distribution({"name": "extended", "ext_modules": [_emath, _test_api]}))
Expand Down
4 changes: 3 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
[project]
requires-python = ">=3.12"

[tool.poetry]
name = "emath"
version = "0.1.11"
description = "Fast immutable math primitives."
authors = ["Erik Soma <[email protected]>"]
include = [
{path = "codegen/*", format = "sdist"},
{path = "src/emath/*.so", format = "wheel"},
{path = "src/emath/*.pyd", format = "wheel"},
]
Expand Down

0 comments on commit 505bdd8

Please sign in to comment.