Skip to content

Commit

Permalink
Support python 3.12 (#29)
Browse files Browse the repository at this point in the history
---------

Co-authored-by: Frankie Dintino <[email protected]>
  • Loading branch information
jairhenrique and fdintino authored Oct 5, 2023
1 parent 27c3e6c commit fb9712d
Show file tree
Hide file tree
Showing 5 changed files with 54 additions and 93 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ jobs:
]
python-version: [
"pypy-3.7",
"3.12",
"3.11",
"3.10",
"3.9",
"3.8",
Expand Down
134 changes: 44 additions & 90 deletions .github/workflows/wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,125 +13,79 @@ env:

jobs:
build:
name: ${{ matrix.python }} ${{ matrix.os-name }} ${{ matrix.platform }}
name: ${{ matrix.python }} ${{ matrix.os-name }} ${{ matrix.arch == 'x86' && 'x86_64' || matrix.os == 'macos-11' && 'arm64' || 'aarch64' }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ "ubuntu-20.04", "macos-11" ]
python: [ "2.7", "3.7", "3.8", "3.9", "3.10", "3.11" ]
platform: [ "x86_64" ]
manylinux-version: [ "2010" ]
macos-target: [ "10.10" ]
python: [ "2.7", "3.7", "3.8", "3.9", "3.10", "3.11", "3.12" ]
arch: [ "x86", "arm" ]
manylinux-version: [ "2014" ]
mb-ml-libc: [ "manylinux" ]
multibuild-sha: [ "34e970c4bc448b73af0127615fc4583b4f247369" ]
exclude:
- python: "3.11"
manylinux-version: "2010"
- python: "3.11"
multibuild-sha: "34e970c4bc448b73af0127615fc4583b4f247369"
- python: "2.7"
os: "ubuntu-20.04"
manylinux-version: "2014"
- python: "3.7"
os: "ubuntu-20.04"
manylinux-version: "2014"
- python: "2.7"
os: "ubuntu-20.04"
arch: "arm"
include:
- os: "macos-11"
os-name: "osx"
- os: "ubuntu-20.04"
python: "2.7"
arch: "x86"
manylinux-version: "2010"
os-name: "manylinux2010"
- os: "macos-11"
os-name: "osx"
platform: "arm64"
python: "3.10"
macos-target: "11.0"
- os: "macos-11"
os-name: "osx"
platform: "arm64"
python: "3.9"
macos-target: "11.0"
- os: "macos-11"
os-name: "osx"
platform: "arm64"
python: "3.8"
macos-target: "11.0"
- os: "macos-11"
os-name: "osx"
platform: "arm64"
- os: "ubuntu-20.04"
python: "3.7"
macos-target: "11.0"
arch: "x86"
manylinux-version: "2010"
os-name: "manylinux2010"
- os: "macos-11"
os-name: "osx"
platform: "arm64"
python: "2.7"
macos-target: "11.0"
- os: "ubuntu-20.04"
manylinux-version: "2014"
os-name: "manylinux2014"
- python: "3.8"
platform: "x86_64"
arch: "x86"
mb-ml-libc: "musllinux"
os: "ubuntu-20.04"
os-name: "musllinux"
manylinux-version: ""
manylinux-version: "_1_1"
- python: "3.9"
platform: "x86_64"
arch: "x86"
mb-ml-libc: "musllinux"
os: "ubuntu-20.04"
os-name: "musllinux"
manylinux-version: ""
manylinux-version: "_1_1"
- python: "3.10"
platform: "x86_64"
arch: "x86"
mb-ml-libc: "musllinux"
os: "ubuntu-20.04"
os-name: "musllinux"
manylinux-version: ""
- python: "3.8"
platform: "aarch64"
os: "ubuntu-20.04"
os-name: "manylinux2014"
manylinux-version: "2014"
- python: "3.9"
platform: "aarch64"
os: "ubuntu-20.04"
os-name: "manylinux2014"
manylinux-version: "2014"
- python: "3.10"
platform: "aarch64"
os: "ubuntu-20.04"
os-name: "manylinux2014"
manylinux-version: "2014"
manylinux-version: "_1_1"
- python: "3.11"
platform: "x86_64"
os: "macos-11"
os-name: "osx"
macos-target: "10.10"
multibuild-sha: "bb32cfec4f755cb146332a0490abcf3187ce61d1"
- python: "3.11"
platform: "arm64"
os: "macos-11"
os-name: "osx"
macos-target: "11.0"
multibuild-sha: "bb32cfec4f755cb146332a0490abcf3187ce61d1"
- python: "3.11"
platform: "x86_64"
arch: "x86"
mb-ml-libc: "musllinux"
os: "ubuntu-20.04"
os-name: "musllinux"
manylinux-version: ""
multibuild-sha: "bb32cfec4f755cb146332a0490abcf3187ce61d1"
- python: "3.11"
platform: "aarch64"
os: "ubuntu-20.04"
os-name: "manylinux2014"
manylinux-version: "2014"
multibuild-sha: "bb32cfec4f755cb146332a0490abcf3187ce61d1"
- python: "3.11"
platform: "x86_64"
manylinux-version: "_1_1"
- python: "3.12"
arch: "x86"
mb-ml-libc: "musllinux"
os: "ubuntu-20.04"
os-name: "manylinux2014"
manylinux-version: "2014"
multibuild-sha: "bb32cfec4f755cb146332a0490abcf3187ce61d1"
os-name: "musllinux"
manylinux-version: "_1_1"
env:
BUILD_COMMIT: HEAD
PLAT: ${{ matrix.platform }}
PLAT: ${{ matrix.arch == 'x86' && 'x86_64' || matrix.os == 'macos-11' && 'arm64' || 'aarch64' }}
MB_PYTHON_VERSION: ${{ matrix.python }}
TRAVIS_OS_NAME: ${{ matrix.os-name }}
MB_ML_VER: ${{ matrix.manylinux-version }}
MACOSX_DEPLOYMENT_TARGET: ${{ matrix.macos-target }}
MACOSX_DEPLOYMENT_TARGET: ${{ matrix.arch == 'arm' && '11.0' || '10.10' }}
MB_ML_LIBC: ${{ matrix.mb-ml-libc }}
steps:
- uses: actions/checkout@v3
Expand All @@ -149,15 +103,15 @@ jobs:
with:
repository: multi-build/multibuild
path: multibuild
ref: ${{ matrix.multibuild-sha }}
ref: ${{ (matrix.python == '3.11' || matrix.python == '3.12') && '452dd2d1705f6b2375369a6570c415beb3163f70' || '34e970c4bc448b73af0127615fc4583b4f247369' }}

- uses: actions/setup-python@v4
with:
python-version: 3.9

- name: Set up QEMU
uses: docker/setup-qemu-action@v2
if: ${{ matrix.platform == 'aarch64' }}
if: ${{ matrix.os == 'ubuntu-20.04' && matrix.arch == 'arm' }}

- name: Setup env_vars
run: |
Expand All @@ -172,7 +126,7 @@ jobs:
with:
path: pillow-avif-plugin/depends/libavif-${{ env.LIBAVIF_VERSION }}
key:
${{ env.LIBAVIF_VERSION }}-${{ hashFiles('pillow-avif-plugin/wheelbuild/*.sh', 'pillow-avif-plugin/.github/workflows/wheels.yml', 'pillow-avif-plugin/depends/*') }}-${{ matrix.os }}-${{ matrix.platform }}
${{ env.LIBAVIF_VERSION }}-${{ hashFiles('pillow-avif-plugin/wheelbuild/*.sh', 'pillow-avif-plugin/.github/workflows/wheels.yml', 'pillow-avif-plugin/depends/*') }}-${{ matrix.os }}-${{ env.PLAT }}

- name: Cache ccache/sccache
uses: actions/cache@v3
Expand All @@ -181,11 +135,11 @@ jobs:
ccache
sccache
key:
cache-${{ matrix.os }}-${{ matrix.os-name }}-${{ matrix.platform }}-${{ hashFiles('pillow-avif-plugin/wheelbuild/*.sh', 'pillow-avif-plugin/.github/workflows/wheels.yml', 'pillow-avif-plugin/depends/*', 'pillow-avif-plugin/**/*.py', 'pillow-avif-plugin/**/*.c') }}-${{ matrix.python }}
cache-${{ matrix.os }}-${{ matrix.os-name }}-${{ env.PLAT }}-${{ hashFiles('pillow-avif-plugin/wheelbuild/*.sh', 'pillow-avif-plugin/.github/workflows/wheels.yml', 'pillow-avif-plugin/depends/*', 'pillow-avif-plugin/**/*.py', 'pillow-avif-plugin/**/*.c') }}-${{ matrix.python }}
restore-keys: |
cache-${{ matrix.os }}-${{ matrix.os-name }}-${{ matrix.platform }}-${{ hashFiles('pillow-avif-plugin/wheelbuild/*.sh', 'pillow-avif-plugin/.github/workflows/wheels.yml', 'pillow-avif-plugin/depends/*', 'pillow-avif-plugin/**/*.py', 'pillow-avif-plugin/**/*.c') }}-${{ matrix.python }}
cache-${{ matrix.os }}-${{ matrix.os-name }}-${{ matrix.platform }}-${{ hashFiles('pillow-avif-plugin/wheelbuild/*.sh', 'pillow-avif-plugin/.github/workflows/wheels.yml', 'pillow-avif-plugin/depends/*', 'pillow-avif-plugin/**/*.py', 'pillow-avif-plugin/**/*.c') }}
cache-${{ matrix.os }}-${{ matrix.os-name }}-${{ matrix.platform }}-
cache-${{ matrix.os }}-${{ matrix.os-name }}-${{ env.PLAT }}-${{ hashFiles('pillow-avif-plugin/wheelbuild/*.sh', 'pillow-avif-plugin/.github/workflows/wheels.yml', 'pillow-avif-plugin/depends/*', 'pillow-avif-plugin/**/*.py', 'pillow-avif-plugin/**/*.c') }}-${{ matrix.python }}
cache-${{ matrix.os }}-${{ matrix.os-name }}-${{ env.PLAT }}-${{ hashFiles('pillow-avif-plugin/wheelbuild/*.sh', 'pillow-avif-plugin/.github/workflows/wheels.yml', 'pillow-avif-plugin/depends/*', 'pillow-avif-plugin/**/*.py', 'pillow-avif-plugin/**/*.c') }}
cache-${{ matrix.os }}-${{ matrix.os-name }}-${{ env.PLAT }}-
- name: Build Wheel
run: pillow-avif-plugin/wheelbuild/build.sh
Expand Down
3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[build-system]
requires = ["setuptools"]
build-backend = "setuptools.build_meta"
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ def readme():
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
"Topic :: Multimedia :: Graphics",
Expand Down
7 changes: 4 additions & 3 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tox]
envlist = py{27,37,38,39,310,py37}
envlist = py{27,37,38,39,310,311,312,py37}
minversion = 1.9

[gh-actions]
Expand All @@ -10,6 +10,8 @@ python =
3.8: py38
3.9: py39
3.10: py310
3.11: py311
3.12: py312
pypy-3.7: pypy37

[testenv]
Expand All @@ -27,8 +29,7 @@ setenv =
GCNO_TARGET_DIR={envdir}/temp
COVERAGE_FILE={toxworkdir}/coverage/.coverage.{envname}
commands =
{envpython} setup.py clean
{envpython} setup.py build_ext --build-lib {envdir}/src --build-temp {envdir} develop
{envpython} -m pip install -e . -v
{envpython} -m pytest -W always {posargs: -vv --cov pillow_avif --cov tests --cov-report term}
{envpython} -c "import os; os.path.exists('{toxworkdir}/coverage') or os.makedirs('{toxworkdir}/coverage')"
- gcovr -r {toxinidir} --object-directory {envdir} -k \
Expand Down

0 comments on commit fb9712d

Please sign in to comment.