Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 66 additions & 0 deletions .github/workflows/python.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: python

on:
push:
branches: [main]
tags: ["py-v*"]
pull_request:
workflow_dispatch:

jobs:
test:
name: build and smoke (${{ matrix.os }})
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest # manylinux x86_64
- os: ubuntu-24.04-arm # manylinux aarch64
- os: macos-latest # arm64
- os: windows-latest # x86_64 msvc
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- uses: dtolnay/rust-toolchain@stable
- name: build wheel
uses: PyO3/maturin-action@v1
with:
maturin-version: latest
args: --release --manifest-path python/Cargo.toml --out target/wheels
- name: smoke test the wheel
run: |
python -m venv /tmp/wheelcheck
# Windows venvs put executables in Scripts/, unix venvs in bin/.
BIN=/tmp/wheelcheck/bin
[ -d /tmp/wheelcheck/Scripts ] && BIN=/tmp/wheelcheck/Scripts
"$BIN/pip" install target/wheels/*.whl
"$BIN/python" python/tests/smoke.py
shell: bash
- uses: actions/upload-artifact@v4
with:
name: wheels-${{ matrix.os }}
path: target/wheels

publish:
name: publish to PyPI
if: startsWith(github.ref, 'refs/tags/py-v')
needs: test
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
environment: pypi
steps:
- uses: actions/download-artifact@v4
with:
path: target/wheels
merge-multiple: true
- name: publish
uses: PyO3/maturin-action@v1
with:
maturin-version: latest
command: publish
args: --manifest-path python/Cargo.toml --skip-existing
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,15 @@
# Locally generated decay demo frames, kept out of the repo.
/demo

# Python bindings build artifacts.
/python/.venv/
/python/*.so
/python/*.pyd
/python/__pycache__/
/python/tests/__pycache__/
/dist/
/target/wheels/

# Documentation lives locally and is never committed.
CLAUDE.md
project.md
Expand Down
Loading
Loading