Skip to content

Modernize numpy

Modernize numpy #34

Workflow file for this run

name: build_and_test
on:
push:
branches:
- main
- master
tags:
- "*"
pull_request:
jobs:
build_and_test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: "pip"
cache-dependency-path: "setup.cfg"
allow-prereleases: true
- name: Update pip/wheel infrastructure
run: |
python -m pip install --upgrade pip
pip install wheel uv
- name: Install pytest packages
run: uv pip install --system pytest
- name: List installed packages
run: pip list -v
- name: Build and install
run: uv pip install --system -v -e .
- name: Run tests
run: |
pytest -Wd test_pal.py
pypi_sdist_build:
runs-on: ubuntu-latest
needs: [build_and_test]
if: startsWith(github.ref, 'refs/tags/')
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
# Full git history.
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.8
- name: Install dependencies
run: |
pip install --upgrade setuptools wheel build
- name: Build and create distribution
run: |
python -m build --sdist
- uses: actions/upload-artifact@v4
with:
name: palpy-sdist
path: dist/*
pypi_wheel_build:
strategy:
matrix:
os: ["ubuntu-latest", "macos-12"]
runs-on: ${{ matrix.os }}
needs: [build_and_test]
if: startsWith(github.ref, 'refs/tags/')
env:
CIBW_BUILD: "cp3{8,9,10,11,12,13}-{manylinux_x86_64,manylinux_aarch64,macosx_arm64,macosx_x86_64}"
CIBW_ARCHS_MACOS: "x86_64 arm64"
# use line below to enable aarch64 builds
# CIBW_ARCHS_LINUX: "auto aarch64"
CIBW_ARCHS_LINUX: "auto"
steps:
# uncomment when building aarch64
# - name: Set up QEMU
# uses: docker/setup-qemu-action@v2
# if: runner.os == 'Linux'
# with:
# platforms: arm64
- uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.8
- name: Install dependencies
run: |
pip install --upgrade setuptools wheel cibuildwheel
- name: Build and create distribution
run: |
python -m cibuildwheel --output-dir dist
- uses: actions/upload-artifact@v4
with:
name: palpy-${{ matrix.os }}
path: dist/*
pypi-publish:
name: Upload release to PyPI
needs: [pypi_sdist_build, pypi_wheel_build]
runs-on: ubuntu-latest
environment: release
permissions:
id-token: write
steps:
- uses: actions/download-artifact@v4
with:
path: dist
pattern: palpy-*
merge-multiple: true
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1