Skip to content

Commit

Permalink
CI clean up, more consistent logic (#114)
Browse files Browse the repository at this point in the history
Signed-off-by: Alexander Piskun <[email protected]>
  • Loading branch information
bigcat88 authored Jul 18, 2023
1 parent 68e4415 commit f1d580a
Show file tree
Hide file tree
Showing 14 changed files with 94 additions and 96 deletions.
8 changes: 2 additions & 6 deletions .github/workflows/publish-wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
needs: [pi_heif_build]
if: "contains(github.event.head_commit.message, '[publish]')"
name: Upload to PyPi
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04

steps:
- uses: actions/checkout@v3
Expand All @@ -46,13 +46,9 @@ jobs:
name: wheels_pi_heif
path: wheelhouse_pi_heif

- name: Install twine
run: |
python3 -m pip install twine
python3 -m pip install urllib3==1.26.15
- name: Publish Pillow-Heif
run: |
python3 -m pip install twine
python3 -m twine upload --skip-existing wheelhouse_pillow_heif/*.whl
python3 -m twine upload --skip-existing wheelhouse_pillow_heif/*tar.gz
env:
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/test-wheels-pi_heif.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ jobs:
{ "os": "oraclelinux", "ver": "9", "arch": "amd64" },
{ "os": "oraclelinux", "ver": "9", "arch": "arm64" },
{ "os": "fedora", "ver": "37", "arch": "amd64" },
{ "os": "debian", "ver": "10", "arch": "amd64" },
{ "os": "debian", "ver": "10", "arch": "arm64" },
{ "os": "debian", "ver": "10", "arch": "arm/v7" },
{ "os": "debian", "ver": "11", "arch": "amd64" },
{ "os": "debian", "ver": "11", "arch": "arm64" },
{ "os": "debian", "ver": "11", "arch": "arm/v7" },
{ "os": "debian", "ver": "12", "arch": "amd64" },
{ "os": "debian", "ver": "12", "arch": "arm64" },
{ "os": "debian", "ver": "12", "arch": "arm/v7" },
{ "os": "alpine", "ver": "3.16", "arch": "amd64" },
{ "os": "alpine", "ver": "3.16", "arch": "arm64" },
{ "os": "alpine", "ver": "3.17", "arch": "amd64" },
Expand All @@ -48,7 +48,7 @@ jobs:
run: |
echo PREPARE_CMD="apt update" >> $GITHUB_ENV
echo INSTALL_CMD="apt install -y \
python3-minimal python3-distutils python3-pip python3-dev \
python3-minimal python3-distutils python3-pip python3-dev python3-venv \
zlib1g-dev libjpeg62-turbo-dev liblcms2-dev libwebp-dev libfribidi-dev libharfbuzz-dev" >> $GITHUB_ENV
- name: Preparing musli
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/test-wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ jobs:
{ "os": "oraclelinux", "ver": "9", "arch": "amd64" },
{ "os": "oraclelinux", "ver": "9", "arch": "arm64" },
{ "os": "fedora", "ver": "37", "arch": "amd64" },
{ "os": "debian", "ver": "10", "arch": "amd64" },
{ "os": "debian", "ver": "10", "arch": "arm64" },
{ "os": "debian", "ver": "11", "arch": "amd64" },
{ "os": "debian", "ver": "11", "arch": "arm64" },
{ "os": "debian", "ver": "12", "arch": "amd64" },
{ "os": "debian", "ver": "12", "arch": "arm64" },
{ "os": "alpine", "ver": "3.16", "arch": "amd64" },
{ "os": "alpine", "ver": "3.16", "arch": "arm64" },
{ "os": "alpine", "ver": "3.17", "arch": "amd64" },
Expand All @@ -47,7 +47,7 @@ jobs:
run: |
echo PREPARE_CMD="apt update" >> $GITHUB_ENV
echo INSTALL_CMD="apt install -y \
python3-minimal python3-distutils python3-pip python3-dev \
python3-minimal python3-distutils python3-pip python3-dev python3-venv \
zlib1g-dev libjpeg62-turbo-dev liblcms2-dev libwebp-dev libfribidi-dev libharfbuzz-dev" >> $GITHUB_ENV
- name: Preparing musli
Expand Down
34 changes: 13 additions & 21 deletions .github/workflows/wheels-pi_heif.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ jobs:

steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Transform to Pi-Heif
run: |
cp -r -v -force ./pi-heif/* .
Expand Down Expand Up @@ -68,13 +71,12 @@ jobs:
- name: Run cibuildwheel
run: |
python3 -m pip install cibuildwheel==2.12.3
python3 -m pip install cibuildwheel==2.14.1
python3 -m cibuildwheel
env:
CIBW_BUILD: "cp37-* cp38-* cp39-* cp310-* cp311-* pp39-*"
CIBW_ARCHS_WINDOWS: "AMD64"
CIBW_REPAIR_WHEEL_COMMAND_WINDOWS: "delvewheel repair -vv -w {dest_dir} {wheel} --add-path ${{ env.MSYS2_PREFIX }}/bin"
CIBW_ARCHS: "AMD64"
CIBW_ENVIRONMENT_WINDOWS: PH_LIGHT_ACTION=1 TEST_DECODE_THREADS=0
CIBW_REPAIR_WHEEL_COMMAND_WINDOWS: "delvewheel repair -vv -w {dest_dir} {wheel} --add-path ${{ env.MSYS2_PREFIX }}/bin"

- name: Checking built wheels
run: |
Expand All @@ -101,10 +103,10 @@ jobs:
- name: Run cibuildwheel
run: |
python3 -m pip install cibuildwheel==2.12.3
python3 -m pip install cibuildwheel==2.14.1
python3 -m cibuildwheel
env:
CIBW_BUILD: "*-macosx_x86_64"
CIBW_ARCHS: "x86_64"
CIBW_ENVIRONMENT_MACOS: PH_LIGHT_ACTION=1 TEST_DECODE_THREADS=0

- name: Checking built wheels
Expand Down Expand Up @@ -151,15 +153,11 @@ jobs:
OS_PACKAGES: "fribidi-dev harfbuzz-dev jpeg-dev lcms2-dev openjpeg-dev"

- name: 32-bit manylinux preparations
if: matrix.cibw_buildlinux == 'manylinux' && matrix.cibw_arch == 'i686'
if: matrix.cibw_buildlinux == 'manylinux'
run: echo INSTALL_OS_PACKAGES="yum makecache && yum install -y $OS_PACKAGES" >> $GITHUB_ENV
env:
OS_PACKAGES: "libjpeg-turbo-devel lcms2-devel"

- name: Only minimal testing on aarch64
if: matrix.cibw_arch == 'aarch64'
run: echo CIBW_TEST_EXTRAS="tests-min" >> $GITHUB_ENV

- uses: actions/cache@v3
with:
path: ${{ env.BUILD_DIR }}
Expand All @@ -170,7 +168,7 @@ jobs:

- name: Run cibuildwheel
run: |
python3 -m pip install cibuildwheel==2.12.3
python3 -m pip install cibuildwheel==2.14.1
python3 -m cibuildwheel
env:
CIBW_BUILD: ${{ format('cp3*-{0}_{1}', matrix.cibw_buildlinux, matrix.cibw_arch) }}
Expand Down Expand Up @@ -198,7 +196,7 @@ jobs:
fail-fast: true
matrix:
cibw_buildlinux: [ manylinux ]
cibw_arch: [ "aarch64", "i686", "x86_64" ]
cibw_arch: [ "aarch64", "x86_64" ]
name: ${{ matrix.cibw_buildlinux }} • ${{ matrix.cibw_arch }} • PyPy
runs-on: ubuntu-20.04
env:
Expand All @@ -218,10 +216,6 @@ jobs:
with:
platforms: arm64

- name: Only minimal testing on aarch64
if: matrix.cibw_arch == 'aarch64'
run: echo CIBW_TEST_EXTRAS="tests-min" >> $GITHUB_ENV

- uses: actions/cache@v3
with:
path: ${{ env.BUILD_DIR }}
Expand All @@ -232,7 +226,7 @@ jobs:

- name: Run cibuildwheel
run: |
python3 -m pip install cibuildwheel==2.12.3
python3 -m pip install cibuildwheel==2.14.1
python3 -m cibuildwheel
env:
CIBW_BUILD: ${{ format('pp3*-{0}_{1}', matrix.cibw_buildlinux, matrix.cibw_arch) }}
Expand Down Expand Up @@ -263,14 +257,12 @@ jobs:
i: [
{ "docker_file": "manylinux_armv7l_wheels", "name": "manylinux" },
]
v: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]
v: ["3.8", "3.9", "3.10", "3.11"]
include:
- v: "3.10"
i: { "docker_file": "musllinux_armv7l_wheels", "name": "musllinux" }
- v: "3.11"
i: { "docker_file": "musllinux_armv7l_wheels", "name": "musllinux" }
- v: "3.12"
i: { "docker_file": "musllinux_armv7l_wheels", "name": "musllinux" }
env:
KEY_HEAD: Pi-Heif-ARMv7l-${{ matrix.i['name'] }}
BUILD_DIR: "./build_cache"
Expand Down
48 changes: 33 additions & 15 deletions .github/workflows/wheels-pillow_heif.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ jobs:

steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.11'
- uses: msys2/setup-msys2@v2
with:
location: C:/temp
Expand Down Expand Up @@ -64,13 +67,12 @@ jobs:
- name: Run cibuildwheel
run: |
python3 -m pip install cibuildwheel==2.12.3
python3 -m pip install cibuildwheel==2.14.1
python3 -m cibuildwheel
env:
CIBW_BUILD: "cp37-* cp38-* cp39-* cp310-* cp311-* pp39-*"
CIBW_ARCHS_WINDOWS: "AMD64"
CIBW_REPAIR_WHEEL_COMMAND_WINDOWS: "delvewheel repair -vv -w {dest_dir} {wheel} --add-path ${{ env.MSYS2_PREFIX }}/bin"
CIBW_ARCHS: "AMD64"
CIBW_ENVIRONMENT_WINDOWS: PH_FULL_ACTION=1
CIBW_REPAIR_WHEEL_COMMAND_WINDOWS: "delvewheel repair -vv -w {dest_dir} {wheel} --add-path ${{ env.MSYS2_PREFIX }}/bin"

- name: Check built wheels
run: |
Expand All @@ -92,10 +94,10 @@ jobs:
- uses: actions/checkout@v3
- name: Run cibuildwheel
run: |
python3 -m pip install cibuildwheel==2.12.3
python3 -m pip install cibuildwheel==2.14.1
python3 -m cibuildwheel
env:
CIBW_BUILD: "*-macosx_x86_64"
CIBW_ARCHS: "x86_64"
CIBW_ENVIRONMENT_MACOS: PH_FULL_ACTION=1 TEST_DECODE_THREADS=0

- name: Check built wheels
Expand Down Expand Up @@ -136,9 +138,11 @@ jobs:
env:
OS_PACKAGES: "fribidi-dev harfbuzz-dev jpeg-dev lcms2-dev openjpeg-dev"

- name: Only minimal testing on aarch64
if: matrix.cibw_arch == 'aarch64'
run: echo CIBW_TEST_EXTRAS="tests-min" >> $GITHUB_ENV
- name: manylinux preparations
if: matrix.cibw_buildlinux == 'manylinux'
run: echo INSTALL_OS_PACKAGES="yum makecache && yum install -y $OS_PACKAGES" >> $GITHUB_ENV
env:
OS_PACKAGES: "libjpeg-turbo-devel lcms2-devel"

- uses: actions/cache@v3
with:
Expand All @@ -148,15 +152,24 @@ jobs:
KEY_LINUX_LIBS: ${{ hashFiles('libheif/linux/**') }}
KEY_C_BUILD: ${{ hashFiles('libheif/linux_*.py') }}-${{ hashFiles('libheif/setup.py') }}

- name: Full testing on x86_64
if: matrix.cibw_arch == 'x86_64'
run: echo PH_TESTS_NO_HEVC_ENC=0 >> $GITHUB_ENV

- name: Minimal testing on aarch64
if: matrix.cibw_arch == 'aarch64'
run: echo PH_TESTS_NO_HEVC_ENC=1 >> $GITHUB_ENV

- name: Run cibuildwheel
run: |
python3 -m pip install cibuildwheel==2.12.3
python3 -m pip install cibuildwheel==2.14.1
python3 -m cibuildwheel
env:
CIBW_BUILD: ${{ format('cp3*-{0}_{1}', matrix.cibw_buildlinux, matrix.cibw_arch) }}
CIBW_ARCHS: ${{ matrix.cibw_arch }}
CIBW_BEFORE_ALL_LINUX: ${{ env.INSTALL_OS_PACKAGES }}
CIBW_ENVIRONMENT_LINUX: BUILD_DIR=/host${{ env.BUILD_DIR }} PH_FULL_ACTION=1
CIBW_ENVIRONMENT_PASS_LINUX: PH_TESTS_NO_HEVC_ENC

- name: Checking built wheels
run: |
Expand Down Expand Up @@ -193,10 +206,6 @@ jobs:
with:
platforms: arm64

- name: Only minimal testing on aarch64
if: matrix.cibw_arch == 'aarch64'
run: echo CIBW_TEST_EXTRAS="tests-min" >> $GITHUB_ENV

- uses: actions/cache@v3
with:
path: ${{ env.BUILD_DIR }}
Expand All @@ -205,15 +214,24 @@ jobs:
KEY_LINUX_LIBS: ${{ hashFiles('libheif/linux/**') }}
KEY_C_BUILD: ${{ hashFiles('libheif/linux_*.py') }}-${{ hashFiles('libheif/setup.py') }}

- name: Full testing on x86_64
if: matrix.cibw_arch == 'x86_64'
run: echo PH_TESTS_NO_HEVC_ENC=0 >> $GITHUB_ENV

- name: Minimal testing on aarch64
if: matrix.cibw_arch == 'aarch64'
run: echo PH_TESTS_NO_HEVC_ENC=1 >> $GITHUB_ENV

- name: Run cibuildwheel
run: |
python3 -m pip install cibuildwheel==2.12.3
python3 -m pip install cibuildwheel==2.14.1
python3 -m cibuildwheel
env:
CIBW_BUILD: ${{ format('pp3*-{0}_{1}', matrix.cibw_buildlinux, matrix.cibw_arch) }}
CIBW_ARCHS: ${{ matrix.cibw_arch }}
CIBW_BEFORE_ALL_LINUX: "yum makecache && yum install -y libjpeg-turbo-devel lcms2-devel"
CIBW_ENVIRONMENT_LINUX: BUILD_DIR=/host${{ env.BUILD_DIR }} PH_FULL_ACTION=1
CIBW_ENVIRONMENT_PASS_LINUX: PH_TESTS_NO_HEVC_ENC

- name: Checking built wheels
run: |
Expand Down
8 changes: 6 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ All notable changes to this project will be documented in this file.

## [0.13.0 - 2023-08-0x]

### Added

- `Python 3.12`, `PyPy 3.10` wheels

### Changed

- The license for the project itself has been changed to "BSD-3-Clause" since "Apache 2.0" is not compatible with the "x265" encoder. #111
Expand All @@ -13,7 +17,7 @@ All notable changes to this project will be documented in this file.

This release is fully compatible with previous versions.

## Added
### Added

- (Heif) restored lost ability after `0.9.x` versions to open HDR images in 10/12 bit. #96

Expand All @@ -22,7 +26,7 @@ This release is fully compatible with previous versions.
- `libde265`(HEIF decoder) updated from 1.0.11 to 1.0.12 version. [changelog](https://github.com/strukturag/libde265/releases/tag/v1.0.12)
- `libheif` updated to `1.16.2`.

## Fixed
### Fixed

- Building from source when using `apt-repository ppa:strukturag/libheif`
- (Heif) `encode` function with `stride` argument correctly saves image.
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,9 +127,9 @@ pillow_heif.register_avif_opener()
| CPython 3.10 ||||||
| CPython 3.11 ||||||
| CPython 3.12 ||||||
| PyPy 3.8 v7.3 || N/A || N/A ||
| PyPy 3.9 v7.3 || N/A || N/A ||
| PyPy 3.9 v7.3 || || N/A ||
| PyPy 3.10 v7.3 || || N/A ||

&ast; **x86_64**, **aarch64** wheels.

`ARMv7l`, `PyPy` 32-bit wheels are published only for [pi-heif](https://pypi.org/project/pi-heif/) from `0.10.0` version.
`i686`, `ARMv7l`, `PyPy` 32-bit wheels are published only for [pi-heif](https://pypi.org/project/pi-heif/) from `0.13.0` version.
10 changes: 2 additions & 8 deletions ci/cirrus_wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,7 @@ wheel_macos_arm_task:

env:
PATH: /opt/homebrew/opt/[email protected]/bin:$PATH
CIBW_SKIP: 'pp* cp36-* cp37-*'
CIBW_BUILD: '*-macosx_arm64'
CIBW_ARCHS: arm64
CIBW_PLATFORM: macos
CIBW_ENVIRONMENT: 'MACOSX_DEPLOYMENT_TARGET=12.0 PH_FULL_ACTION=1'

install_pre_requirements_script:
Expand All @@ -19,7 +16,7 @@ wheel_macos_arm_task:
- brew install [email protected]
- ln -s python3 /opt/homebrew/opt/[email protected]/bin/python
install_cibuildwheel_script:
- python3 -m pip install cibuildwheel==2.12.3
- python3 -m pip install cibuildwheel==2.14.1
run_cibuildwheel_script:
- python3 -m cibuildwheel
wheels_artifacts:
Expand All @@ -34,10 +31,7 @@ wheel_pi_heif_macos_arm_task:

env:
PATH: /opt/homebrew/opt/[email protected]/bin:$PATH
CIBW_SKIP: 'pp* cp36-* cp37-*'
CIBW_BUILD: '*-macosx_arm64'
CIBW_ARCHS: arm64
CIBW_PLATFORM: macos
CIBW_ENVIRONMENT: 'MACOSX_DEPLOYMENT_TARGET=12.0 PH_LIGHT_ACTION=1'

install_pre_requirements_script:
Expand All @@ -46,7 +40,7 @@ wheel_pi_heif_macos_arm_task:
- brew install [email protected]
- ln -s python3 /opt/homebrew/opt/[email protected]/bin/python
install_cibuildwheel_script:
- python3 -m pip install cibuildwheel==2.12.3
- python3 -m pip install cibuildwheel==2.14.1
transform_to_pi_heif_script:
- cp -r -v ./pi-heif/* .
- python3 .github/transform_to-pi_heif.py
Expand Down
Loading

0 comments on commit f1d580a

Please sign in to comment.