Skip to content

Fix Python 3.12 compatibility #43

Fix Python 3.12 compatibility

Fix Python 3.12 compatibility #43

Workflow file for this run

name: CI
on: [push, pull_request]
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
BUILDMODE: [CIBUILDWHEEL, UNITTEST]
python-version: ["3.9", "3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- name: Set up QEMU
if: ${{ matrix.os == 'ubuntu-latest' && matrix.BUILDMODE == 'CIBUILDWHEEL' }}
id: qemu
uses: docker/setup-qemu-action@v1
- name: Setup Conda Environment
if: ${{ matrix.BUILDMODE == 'UNITTEST' }}
uses: conda-incubator/setup-miniconda@v2
with:
miniforge-variant: Mambaforge
miniforge-version: latest
use-mamba: true
python-version: ${{ matrix.python-version }}
environment-file: ci/environment.yaml
activate-environment: test-environment
- name: Run tests
if: ${{ matrix.BUILDMODE == 'UNITTEST' }}
shell: bash -l {0}
run: |
pip install -e .
python selftest.py
- name: Build wheel
if: ${{ matrix.BUILDMODE == 'CIBUILDWHEEL' }}
env:
CIBW_TEST_COMMAND: python {project}/selftest.py
CIBW_BEFORE_BUILD_LINUX: yum install -y freetype-devel
CIBW_SKIP: "cp36-* pp* *-win32 *-manylinux_i686 *-musllinux*"
CIBW_TEST_REQUIRES: numpy pillow pytest
CIBW_ARCHS_LINUX: auto aarch64
# disable finding unintended freetype installations
CIBW_ENVIRONMENT_WINDOWS: "AGGDRAW_FREETYPE_ROOT=''"
run: |
python -m pip install cibuildwheel
cibuildwheel --output-dir wheelhouse
- name: upload
if: ${{ matrix.BUILDMODE == 'CIBUILDWHEEL' }}
uses: actions/upload-artifact@v2
with:
name: wheelhouse
path: "wheelhouse/*.whl"
publish:
runs-on: ubuntu-latest
needs:
- build
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- name: sdist
run: |
python -m pip install -U build pip
python -m build -s
- name: download
uses: actions/download-artifact@v2
with:
name: wheelhouse
path: dist
- name: Publish package to PyPI
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/v')
uses: pypa/gh-action-pypi-publish@v1.4.1
with:
user: __token__
password: ${{ secrets.pypi_password }}