Skip to content

Commit 58554de

Browse files
authored
Merge branch 'main' into main
2 parents b8769d1 + 4a4b90c commit 58554de

215 files changed

Lines changed: 2749 additions & 2268 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.ci/requirements-cibw.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
cibuildwheel==2.16.2
1+
cibuildwheel==2.16.5

.github/workflows/docs.yml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,16 +37,26 @@ jobs:
3737
with:
3838
python-version: "3.x"
3939
cache: pip
40-
cache-dependency-path: ".ci/*.sh"
40+
cache-dependency-path: |
41+
".ci/*.sh"
42+
"pyproject.toml"
4143
4244
- name: Build system information
4345
run: python3 .github/workflows/system-info.py
4446

47+
- name: Cache libimagequant
48+
uses: actions/cache@v4
49+
id: cache-libimagequant
50+
with:
51+
path: ~/cache-libimagequant
52+
key: ${{ runner.os }}-libimagequant-${{ hashFiles('depends/install_imagequant.sh') }}
53+
4554
- name: Install Linux dependencies
4655
run: |
4756
.ci/install.sh
4857
env:
4958
GHA_PYTHON_VERSION: "3.x"
59+
GHA_LIBIMAGEQUANT_CACHE_HIT: ${{ steps.cache-libimagequant.outputs.cache-hit }}
5060

5161
- name: Build
5262
run: |

.github/workflows/lint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
- uses: actions/checkout@v4
2424

2525
- name: pre-commit cache
26-
uses: actions/cache@v3
26+
uses: actions/cache@v4
2727
with:
2828
path: ~/.cache/pre-commit
2929
key: lint-pre-commit-${{ hashFiles('**/.pre-commit-config.yaml') }}

.github/workflows/macos-install.sh

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,16 @@
22

33
set -e
44

5-
brew install libtiff libjpeg openjpeg libimagequant webp little-cms2 freetype libraqm
5+
brew install \
6+
freetype \
7+
ghostscript \
8+
libimagequant \
9+
libjpeg \
10+
libraqm \
11+
libtiff \
12+
little-cms2 \
13+
openjpeg \
14+
webp
615
export PKG_CONFIG_PATH="/usr/local/opt/openblas/lib/pkgconfig"
716

817
# TODO Update condition when cffi supports 3.13

.github/workflows/test-cygwin.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ jobs:
4747
uses: actions/checkout@v4
4848

4949
- name: Install Cygwin
50-
uses: cygwin/cygwin-install-action@v4
50+
uses: egor-tensin/setup-cygwin@v4
5151
with:
5252
platform: x86_64
5353
packages: >
@@ -69,6 +69,7 @@ jobs:
6969
make
7070
netpbm
7171
perl
72+
python39=3.9.16-1
7273
python3${{ matrix.python-minor-version }}-cffi
7374
python3${{ matrix.python-minor-version }}-cython
7475
python3${{ matrix.python-minor-version }}-devel
@@ -86,7 +87,7 @@ jobs:
8687

8788
- name: Select Python version
8889
run: |
89-
ln -sf c:/cygwin/bin/python3.${{ matrix.python-minor-version }} c:/cygwin/bin/python3
90+
ln -sf c:/tools/cygwin/bin/python3.${{ matrix.python-minor-version }} c:/tools/cygwin/bin/python3
9091
9192
- name: Get latest NumPy version
9293
id: latest-numpy
@@ -95,7 +96,7 @@ jobs:
9596
python3 -m pip list --outdated | grep numpy | sed -r 's/ +/ /g' | cut -d ' ' -f 3 | sed 's/^/version=/' >> $GITHUB_OUTPUT
9697
9798
- name: pip cache
98-
uses: actions/cache@v3
99+
uses: actions/cache@v4
99100
with:
100101
path: 'C:\cygwin\home\runneradmin\.cache\pip'
101102
key: ${{ runner.os }}-cygwin-pip3.${{ matrix.python-minor-version }}-numpy${{ steps.latest-numpy.outputs.version }}-${{ hashFiles('.ci/install.sh') }}

.github/workflows/test-windows.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ jobs:
8989

9090
- name: Cache build
9191
id: build-cache
92-
uses: actions/cache@v3
92+
uses: actions/cache@v4
9393
with:
9494
path: winbuild\build
9595
key:

.github/workflows/test.yml

Lines changed: 29 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,17 @@ concurrency:
2626
group: ${{ github.workflow }}-${{ github.ref }}
2727
cancel-in-progress: true
2828

29+
env:
30+
FORCE_COLOR: 1
31+
2932
jobs:
3033
build:
3134

3235
strategy:
3336
fail-fast: false
3437
matrix:
3538
os: [
36-
"macos-latest",
39+
"macos-14",
3740
"ubuntu-latest",
3841
]
3942
python-version: [
@@ -47,11 +50,21 @@ jobs:
4750
"3.8",
4851
]
4952
include:
50-
- python-version: "3.9"
53+
- python-version: "3.11"
5154
PYTHONOPTIMIZE: 1
5255
REVERSE: "--reverse"
53-
- python-version: "3.8"
56+
- python-version: "3.10"
5457
PYTHONOPTIMIZE: 2
58+
# M1 only available for 3.10+
59+
- os: "macos-latest"
60+
python-version: "3.9"
61+
- os: "macos-latest"
62+
python-version: "3.8"
63+
exclude:
64+
- os: "macos-14"
65+
python-version: "3.9"
66+
- os: "macos-14"
67+
python-version: "3.8"
5568

5669
runs-on: ${{ matrix.os }}
5770
name: ${{ matrix.os }} Python ${{ matrix.python-version }}
@@ -65,17 +78,28 @@ jobs:
6578
python-version: ${{ matrix.python-version }}
6679
allow-prereleases: true
6780
cache: pip
68-
cache-dependency-path: ".ci/*.sh"
81+
cache-dependency-path: |
82+
".ci/*.sh"
83+
"pyproject.toml"
6984
7085
- name: Build system information
7186
run: python3 .github/workflows/system-info.py
7287

88+
- name: Cache libimagequant
89+
if: startsWith(matrix.os, 'ubuntu')
90+
uses: actions/cache@v4
91+
id: cache-libimagequant
92+
with:
93+
path: ~/cache-libimagequant
94+
key: ${{ runner.os }}-libimagequant-${{ hashFiles('depends/install_imagequant.sh') }}
95+
7396
- name: Install Linux dependencies
7497
if: startsWith(matrix.os, 'ubuntu')
7598
run: |
7699
.ci/install.sh
77100
env:
78101
GHA_PYTHON_VERSION: ${{ matrix.python-version }}
102+
GHA_LIBIMAGEQUANT_CACHE_HIT: ${{ steps.cache-libimagequant.outputs.cache-hit }}
79103

80104
- name: Install macOS dependencies
81105
if: startsWith(matrix.os, 'macOS')
@@ -127,7 +151,7 @@ jobs:
127151
- name: Upload coverage
128152
uses: codecov/codecov-action@v3
129153
with:
130-
flags: ${{ matrix.os == 'macos-latest' && 'GHA_macOS' || 'GHA_Ubuntu' }}
154+
flags: ${{ matrix.os == 'ubuntu-latest' && 'GHA_Ubuntu' || 'GHA_macOS' }}
131155
name: ${{ matrix.os }} Python ${{ matrix.python-version }}
132156
gcov: true
133157

.pre-commit-config.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ repos:
3232
rev: v4.5.0
3333
hooks:
3434
- id: check-executables-have-shebangs
35+
- id: check-shebang-scripts-are-executable
3536
- id: check-merge-conflict
3637
- id: check-json
3738
- id: check-toml

CHANGES.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ Changelog (Pillow)
55
10.3.0 (unreleased)
66
-------------------
77

8+
- Do not support using test-image-results to upload images after test failures #7739
9+
[radarhere]
10+
11+
- Changed ImageMath.ops to be static #7721
12+
[radarhere]
13+
814
- Fix APNG info after seeking backwards more than twice #7701
915
[esoma, radarhere]
1016

Tests/bench_cffi_access.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
from __future__ import annotations
2+
23
import time
34

45
from PIL import PyAccess
@@ -8,21 +9,21 @@
89
# Not running this test by default. No DOS against CI.
910

1011

11-
def iterate_get(size, access):
12+
def iterate_get(size, access) -> None:
1213
(w, h) = size
1314
for x in range(w):
1415
for y in range(h):
1516
access[(x, y)]
1617

1718

18-
def iterate_set(size, access):
19+
def iterate_set(size, access) -> None:
1920
(w, h) = size
2021
for x in range(w):
2122
for y in range(h):
2223
access[(x, y)] = (x % 256, y % 256, 0)
2324

2425

25-
def timer(func, label, *args):
26+
def timer(func, label, *args) -> None:
2627
iterations = 5000
2728
starttime = time.time()
2829
for x in range(iterations):
@@ -37,7 +38,7 @@ def timer(func, label, *args):
3738
)
3839

3940

40-
def test_direct():
41+
def test_direct() -> None:
4142
im = hopper()
4243
im.load()
4344
# im = Image.new("RGB", (2000, 2000), (1, 3, 2))

0 commit comments

Comments
 (0)