Skip to content

Add official support for Python 3.12. #346

Add official support for Python 3.12.

Add official support for Python 3.12. #346

Workflow file for this run

name: Continuous Integration
on: [push, pull_request]
jobs:
build:
strategy:
# Allows for matrix sub-jobs to fail without canceling the rest
fail-fast: false
matrix:
os:
- windows-2019
- ubuntu-20.04
- macos-11
- macos-latest
python-version:
- "2.7"
- "3.12"
- "3.11"
- "3.10"
- "3.9"
- "3.8"
- "3.7"
- "3.6"
- "pypy-2.7"
- "pypy-3.7"
- "pypy-3.8"
- "pypy-3.9"
- "pypy-3.10"
lua-version:
- "bundle"
- "lua5.3"
- "lua5.2"
- "luajit-5.1"
exclude:
- os: windows-2019
python-version: 2.7
- os: windows-2019
python-version: pypy-2.7
- os: windows-2019
lua-version: lua5.2
- os: windows-2019
lua-version: lua5.3
- os: windows-2019
lua-version: lua5.4
- os: windows-2019
lua-version: luajit-5.1
- os: macos-11
python-version: 2.7
- os: macos-11
lua-version: lua5.2
- os: macos-11
lua-version: lua5.3
- os: macos-11
lua-version: lua5.4
- os: macos-11
lua-version: luajit-5.1
- os: macos-latest
python-version: 2.7
- os: macos-latest
lua-version: lua5.2
- os: macos-latest
lua-version: lua5.3
- os: macos-latest
lua-version: lua5.4
- os: macos-latest
lua-version: luajit-5.1
runs-on: ${{ matrix.os }}
env:
CFLAGS_LTO: ${{ contains(matrix.lua-version, 'bundle') && (contains(matrix.os, 'windows') && '/LTCG' || '-flto') || '' }}
CFLAGS: ${{ contains(matrix.os, 'windows') && '/O2' || '-O2 -fPIC' }} -g
MACOSX_DEPLOYMENT_TARGET: "11.0"
steps:
- uses: actions/checkout@v3
- name: Check out recursively
run: git submodule update --init --recursive
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Set up Python packages
run: |
python -m pip install -U ${{ contains(matrix.python-version, '-dev') && 'pip setuptools' || '"pip<21" "setuptools<45"' }}
python -m pip install -U wheel tox virtualenv -r requirements.txt
- name: Set up Lua ${{ matrix.lua-version }}
if: ${{ contains(matrix.os, 'ubuntu') && !contains(matrix.lua-version, 'bundle') }}
run: sudo apt-get install lib${{ matrix.lua-version }}-dev
- name: Build wheel
run: python setup.py sdist ${{ contains(matrix.python-version, '3.') && 'build_ext -j6' || '' }} bdist_wheel
env:
SETUP_OPTIONS: ${{ !contains(matrix.lua-version, 'luajit') && (contains(matrix.lua-version, 'bundle') && '--use-bundle' || '--no-luajit') || '' }}
CFLAGS: ${{ env.CFLAGS }} ${{ env.CFLAGS_LTO }}
LDFLAGS: ${{ env.CFLAGS_LTO }}
- name: Run tests
run: python setup.py test
continue-on-error: ${{ contains(matrix.python-version, 'pypy') }}
env:
SETUP_OPTIONS: ${{ !contains(matrix.lua-version, 'luajit') && (contains(matrix.lua-version, 'bundle') && '--use-bundle' || '--no-luajit') || '' }}
CFLAGS: ${{ env.CFLAGS }} ${{ env.CFLAGS_LTO }}
LDFLAGS: ${{ env.CFLAGS_LTO }}
- name: Upload wheels
if: ${{ contains(matrix.lua-version, 'bundle') }}
uses: actions/upload-artifact@v3
with:
name: wheels-${{ runner.os }}
path: dist/*.whl
if-no-files-found: ignore