set requires-python to >=3.9. #72 #386
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
push: | |
branches: | |
- main | |
tags: | |
- 'v*' | |
# release: | |
# types: [ created ] | |
pull_request: | |
branches: | |
- main | |
workflow_dispatch: | |
permissions: | |
contents: read | |
env: | |
PYTHON_VERSION: "3.9" | |
RUST_BACKTRACE: "1" | |
jobs: | |
linux-x86_64: | |
runs-on: ubuntu-latest | |
needs: | |
- rusttest | |
- black | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: ${{env.PYTHON_VERSION}} | |
- name: Install dependencies | |
run: python h3ronpy/install-dev-dependencies.py | |
- name: Build wheels | |
uses: PyO3/maturin-action@v1 | |
env: | |
RUSTFLAGS: "-C target-feature=+fxsr,+sse,+sse2,+sse3,+ssse3,+sse4.1,+sse4.2,+popcnt,+avx,+fma" | |
with: | |
target: x86_64 | |
args: > | |
--release | |
--manifest-path h3ronpy/Cargo.toml | |
--out dist | |
manylinux: auto | |
- name: Upload wheels | |
uses: actions/upload-artifact@v4 | |
with: | |
name: wheels-linux-x86_64 | |
path: dist | |
- name: pytest | |
shell: bash | |
run: | | |
set -e | |
pip install --force-reinstall dist/*.whl | |
python -m pytest -s h3ronpy/tests | |
linux-aarch64: | |
runs-on: ubuntu-latest | |
needs: | |
- rusttest | |
- black | |
- linux-x86_64 | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: ${{env.PYTHON_VERSION}} | |
- name: Install dependencies | |
run: python h3ronpy/install-dev-dependencies.py | |
- name: Build wheels | |
uses: PyO3/maturin-action@v1 | |
with: | |
target: aarch64-unknown-linux-gnu | |
args: > | |
--release | |
--manifest-path h3ronpy/Cargo.toml | |
--out dist | |
manylinux: auto | |
- name: Upload wheels | |
uses: actions/upload-artifact@v4 | |
with: | |
name: wheels-linux-aarch64 | |
path: dist | |
windows-x86_64: | |
needs: | |
- rusttest | |
- black | |
- linux-x86_64 | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ env.PYTHON_VERSION }} | |
- name: Install dependencies | |
run: python h3ronpy/install-dev-dependencies.py | |
- name: Build wheels | |
uses: PyO3/maturin-action@v1 | |
env: | |
RUSTFLAGS: "-C target-feature=+fxsr,+sse,+sse2,+sse3,+sse4.1,+sse4.2" | |
with: | |
target: x86_64 | |
args: > | |
--release | |
--manifest-path h3ronpy/Cargo.toml | |
--out dist | |
-i python | |
- name: Upload wheels | |
uses: actions/upload-artifact@v4 | |
with: | |
name: wheels-windows-x86_64 | |
path: dist | |
- name: pytest | |
shell: bash | |
run: | | |
set -e | |
pip install --force-reinstall dist/*.whl | |
python -m pytest h3ronpy/tests | |
macos-x86_64: | |
needs: | |
- rusttest | |
- black | |
- linux-x86_64 | |
runs-on: macos-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
with: | |
# https://github.com/pypa/cibuildwheel/issues/1410 | |
python-version: ${{ env.PYTHON_VERSION }} | |
- name: Install dependencies | |
shell: bash | |
run: | | |
python h3ronpy/install-dev-dependencies.py | |
pip install --upgrade pip | |
- name: Build wheels | |
uses: PyO3/maturin-action@v1 | |
env: | |
RUSTFLAGS: "-C target-feature=+sse3,+ssse3,+sse4.1,+sse4.2,+popcnt,+avx,+fma" | |
# lower versions result in "illegal instruction" | |
MACOSX_DEPLOYMENT_TARGET: "10.14" | |
with: | |
target: x86_64 | |
args: > | |
--release | |
--manifest-path h3ronpy/Cargo.toml | |
--out dist | |
-i python | |
- name: Upload wheels | |
uses: actions/upload-artifact@v4 | |
with: | |
name: wheels-macos-x86_64 | |
path: dist | |
#- name: pytest | |
# shell: bash | |
# run: | | |
# set -e | |
# pip install --force-reinstall --verbose dist/*.whl | |
# python -m pytest h3ronpy/tests | |
macos-aarch64: | |
runs-on: macos-latest | |
needs: | |
- rusttest | |
- black | |
- linux-x86_64 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Rust targets | |
run: rustup target add aarch64-apple-darwin | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: ${{env.PYTHON_VERSION}} | |
- name: Install dependencies | |
run: | | |
python h3ronpy/install-dev-dependencies.py | |
- name: Build wheels | |
uses: PyO3/maturin-action@v1 | |
with: | |
target: aarch64-apple-darwin | |
args: > | |
--release | |
--manifest-path h3ronpy/Cargo.toml | |
--out dist | |
- name: Upload wheels | |
uses: actions/upload-artifact@v4 | |
with: | |
name: wheels-macos-aarch64 | |
path: dist | |
# sdist: | |
# runs-on: ubuntu-latest | |
# if: "startsWith(github.ref, 'refs/tags/v')" | |
# needs: | |
# - rusttest | |
# - black | |
# steps: | |
# - uses: actions/checkout@v4 | |
# - name: Build sdist | |
# uses: PyO3/maturin-action@v1 | |
# with: | |
# command: sdist | |
# args: > | |
# --manifest-path h3ronpy/Cargo.toml | |
# --out dist | |
# - name: Upload sdist | |
# uses: actions/upload-artifact@v4 | |
# with: | |
# name: sdist | |
# path: dist | |
release: | |
name: Release | |
runs-on: ubuntu-latest | |
if: "startsWith(github.ref, 'refs/tags/v')" | |
needs: [ linux-x86_64, linux-aarch64, windows-x86_64, macos-x86_64, macos-aarch64 ] | |
steps: | |
- uses: actions/download-artifact@v4 | |
with: | |
name: wheels-linux-x86_64 | |
- uses: actions/download-artifact@v4 | |
with: | |
name: wheels-linux-aarch64 | |
- uses: actions/download-artifact@v4 | |
with: | |
name: wheels-windows-x86_64 | |
- uses: actions/download-artifact@v4 | |
with: | |
name: wheels-macos-aarch64 | |
- uses: actions/download-artifact@v4 | |
with: | |
name: wheels-macos-x86_64 | |
#- uses: actions/download-artifact@v4 | |
# with: | |
# name: sdist | |
- name: Publish to PyPI | |
uses: PyO3/maturin-action@v1 | |
env: | |
MATURIN_PYPI_TOKEN: ${{ secrets.PYPI }} | |
with: | |
command: upload | |
args: --skip-existing * | |
rusttest: | |
name: rust test | |
runs-on: ubuntu-latest | |
steps: | |
- name: checkout repo | |
uses: actions/checkout@v4 | |
- name: run rustfmt | |
run: | | |
cargo fmt -- --check | |
- name: Lint with clippy -- no features | |
run: cargo clippy --workspace --exclude h3ronpy | |
- name: Test with cargo -- no features | |
run: cargo test --workspace --exclude h3ronpy | |
- name: Lint with clippy -- all features | |
run: cargo clippy --workspace --exclude h3ronpy --all-features | |
- name: Test with cargo -- all features | |
run: cargo test --workspace --all-features --exclude h3ronpy | |
black: | |
name: black | |
runs-on: ubuntu-latest | |
steps: | |
- name: checkout repo | |
uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: ${{env.PYTHON_VERSION}} | |
- name: Install black | |
run: | | |
pip install black | |
- name: run black | |
working-directory: h3ronpy | |
run: | | |
black --check -l 120 python tests *.py docs/source/*.py |