Skip to content
This repository was archived by the owner on Oct 8, 2024. It is now read-only.

Commit d579370

Browse files
authored
Merge pull request #271 from radarhere/musllinux
2 parents 55c6d67 + 0148bd8 commit d579370

7 files changed

Lines changed: 93 additions & 35 deletions

File tree

.github/workflows/build.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ if [[ "$MB_PYTHON_VERSION" == pypy3* ]]; then
1919
else
2020
DOCKER_TEST_IMAGE="multibuild/focal_$PLAT"
2121
fi
22+
elif [[ "$MB_ML_LIBC" == "manylinux" ]] && [[ "$PLAT" == "x86_64" ]]; then
23+
DOCKER_TEST_IMAGE="matthewbrett/trusty:64"
2224
fi
2325

2426
echo "::group::Install a virtualenv"

.github/workflows/wheels-linux.yml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: Build Linux wheels
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
build-commit:
7+
required: true
8+
type: string
9+
artifacts-name:
10+
required: true
11+
type: string
12+
13+
env:
14+
REPO_DIR: Pillow
15+
TEST_DEPENDS: "pytest pytest-timeout"
16+
17+
jobs:
18+
build:
19+
name: ${{ matrix.python }} ${{ matrix.mb-ml-libc }} ${{ matrix.platform }}
20+
runs-on: "ubuntu-20.04"
21+
strategy:
22+
fail-fast: false
23+
matrix:
24+
python: [ "pypy3.7-7.3.8", "pypy3.8-7.3.8", "3.7", "3.8", "3.9", "3.10" ]
25+
platform: [ "i686", "x86_64" ]
26+
mb-ml-libc: [ "manylinux" ]
27+
include:
28+
- python: "3.8"
29+
platform: "x86_64"
30+
mb-ml-libc: "musllinux"
31+
- python: "3.9"
32+
platform: "x86_64"
33+
mb-ml-libc: "musllinux"
34+
- python: "3.10"
35+
platform: "x86_64"
36+
mb-ml-libc: "musllinux"
37+
env:
38+
BUILD_COMMIT: ${{ inputs.build-commit }}
39+
PLAT: ${{ matrix.platform }}
40+
MB_PYTHON_VERSION: ${{ matrix.python }}
41+
MB_ML_LIBC: ${{ matrix.mb-ml-libc }}
42+
steps:
43+
- uses: actions/checkout@v3
44+
with:
45+
submodules: true
46+
- uses: actions/setup-python@v3
47+
with:
48+
python-version: "3.10"
49+
- name: Build Wheel
50+
run: .github/workflows/build.sh
51+
- uses: actions/upload-artifact@v3
52+
with:
53+
name: ${{ inputs.artifacts-name }}
54+
path: wheelhouse/*.whl
55+
# Uncomment to get SSH access for testing
56+
# - name: Setup tmate session
57+
# if: failure()
58+
# uses: mxschmitt/action-tmate@v3
Lines changed: 8 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Build wheels
1+
name: Build macOS wheels
22

33
on:
44
workflow_call:
@@ -12,44 +12,29 @@ on:
1212

1313
env:
1414
REPO_DIR: Pillow
15-
BUILD_DEPENDS: ""
1615
TEST_DEPENDS: "pytest pytest-timeout"
17-
WHEEL_SDIR: wheelhouse
1816

1917
jobs:
2018
build:
21-
name: ${{ matrix.os-name }} ${{ matrix.python }} ${{ matrix.platform }}
22-
runs-on: ${{ matrix.os }}
19+
name: ${{ matrix.python }} ${{ matrix.platform }}
20+
runs-on: "macos-latest"
2321
strategy:
2422
fail-fast: false
2523
matrix:
26-
os: [ "macos-latest", "ubuntu-20.04" ]
2724
python: [ "pypy3.7-7.3.8", "pypy3.8-7.3.8", "3.7", "3.8", "3.9", "3.10" ]
28-
platform: [ "arm64", "x86_64", "i686" ]
25+
platform: [ "x86_64", "arm64" ]
2926
exclude:
30-
- os: "macos-latest"
31-
platform: "i686"
32-
- os: "macos-latest"
27+
- python: "3.7"
3328
platform: "arm64"
34-
python: "3.7"
35-
- os: "macos-latest"
29+
- python: "pypy3.7-7.3.8"
3630
platform: "arm64"
37-
python: "pypy3.7-7.3.8"
38-
- os: "macos-latest"
31+
- python: "pypy3.8-7.3.8"
3932
platform: "arm64"
40-
python: "pypy3.8-7.3.8"
41-
- os: "ubuntu-20.04"
42-
platform: "arm64"
43-
include:
44-
- os: "macos-latest"
45-
os-name: "osx"
46-
- os: "ubuntu-20.04"
47-
os-name: "focal"
4833
env:
4934
BUILD_COMMIT: ${{ inputs.build-commit }}
5035
PLAT: ${{ matrix.platform }}
5136
MB_PYTHON_VERSION: ${{ matrix.python }}
52-
TRAVIS_OS_NAME: ${{ matrix.os-name }}
37+
TRAVIS_OS_NAME: "osx"
5338
steps:
5439
- uses: actions/checkout@v3
5540
with:

.github/workflows/wheels.yml

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,24 +3,37 @@ name: Wheels
33
on: [push, pull_request, workflow_dispatch]
44

55
jobs:
6-
build:
7-
uses: ./.github/workflows/wheels-build.yml
6+
macos:
7+
uses: ./.github/workflows/wheels-macos.yml
88
with:
99
build-commit: "HEAD"
1010
artifacts-name: "wheels"
1111

12-
build-latest:
12+
linux:
13+
uses: ./.github/workflows/wheels-linux.yml
14+
with:
15+
build-commit: "HEAD"
16+
artifacts-name: "wheels"
17+
18+
macos-latest:
19+
if: "!startsWith(github.ref, 'refs/tags/')"
20+
uses: ./.github/workflows/wheels-macos.yml
21+
with:
22+
build-commit: "main"
23+
artifacts-name: "wheels-latest"
24+
25+
linux-latest:
1326
if: "!startsWith(github.ref, 'refs/tags/')"
14-
uses: ./.github/workflows/wheels-build.yml
27+
uses: ./.github/workflows/wheels-linux.yml
1528
with:
1629
build-commit: "main"
1730
artifacts-name: "wheels-latest"
1831

1932
release:
2033
name: Create Release
21-
runs-on: ubuntu-latest
34+
runs-on: linux-latest
2235
if: "startsWith(github.ref, 'refs/tags/')"
23-
needs: build
36+
needs: [macos, linux]
2437
steps:
2538
- uses: actions/download-artifact@v3
2639
with:
@@ -32,7 +45,7 @@ jobs:
3245
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3346

3447
success:
35-
needs: [build, build-latest]
48+
needs: [macos, linux, macos-latest, linux-latest]
3649
runs-on: ubuntu-latest
3750
name: Wheels Successful
3851
steps:

.gitmodules

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33
url = https://github.com/python-Pillow/Pillow.git
44
[submodule "multibuild"]
55
path = multibuild
6-
url = https://github.com/multi-build/multibuild.git
6+
url = https://github.com/radarhere/multibuild.git

config.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ function pre_build {
5151
untar pillow-depends-main.zip
5252

5353
build_xz
54-
if [ -z "$IS_MACOS" ]; then
54+
if [ -z "$IS_ALPINE" ] && [ -z "$IS_MACOS" ]; then
5555
yum remove -y zlib-devel
5656
fi
5757
build_new_zlib
@@ -140,7 +140,7 @@ function run_tests_in_repo {
140140
EXP_CODECS="jpg jpg_2000"
141141
EXP_CODECS="$EXP_CODECS libtiff zlib"
142142
EXP_MODULES="freetype2 littlecms2 pil tkinter webp"
143-
if [ -z "$IS_MACOS" ] && [[ "$MB_PYTHON_VERSION" != pypy3* ]] && [[ "$MACHTYPE" != aarch64* ]]; then
143+
if [ -z "$IS_MACOS" ] && [ -z "$IS_ALPINE" ] && [[ "$MB_PYTHON_VERSION" != pypy3* ]] && [[ "$MACHTYPE" != aarch64* ]]; then
144144
EXP_FEATURES="fribidi harfbuzz libjpeg_turbo raqm transp_webp webp_anim webp_mux xcb"
145145
else
146146
# can't find FriBiDi
@@ -156,7 +156,7 @@ function run_tests {
156156
python3 -m pip install numpy==1.21.4
157157
elif [[ "$MB_PYTHON_VERSION" == 3.8 || "$MB_PYTHON_VERSION" == 3.9 ]] && [[ $(uname -m) == "i686" ]]; then
158158
python3 -m pip install numpy==1.21.5
159-
else
159+
elif [ -z "$IS_ALPINE" ]; then
160160
python3 -m pip install numpy
161161
fi
162162

0 commit comments

Comments
 (0)