Skip to content

Commit d8f52f5

Browse files
authored
Merge branch 'main' into main
2 parents 8156798 + fe09f0d commit d8f52f5

116 files changed

Lines changed: 1881 additions & 1816 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.

.github/workflows/release-drafter.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,6 @@ jobs:
2323
runs-on: ubuntu-latest
2424
steps:
2525
# Drafts your next release notes as pull requests are merged into "main"
26-
- uses: release-drafter/release-drafter@v5
26+
- uses: release-drafter/release-drafter@v6
2727
env:
2828
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/test-cygwin.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ jobs:
4949
- name: Install Cygwin
5050
uses: egor-tensin/setup-cygwin@v4
5151
with:
52-
platform: x86_64
5352
packages: >
5453
gcc-g++
5554
ghostscript
@@ -81,7 +80,7 @@ jobs:
8180
zlib-devel
8281
8382
- name: Add Lapack to PATH
84-
uses: egor-tensin/cleanup-path@v3
83+
uses: egor-tensin/cleanup-path@v4
8584
with:
8685
dirs: 'C:\cygwin\bin;C:\cygwin\lib\lapack'
8786

@@ -142,7 +141,7 @@ jobs:
142141
bash.exe .ci/after_success.sh
143142
144143
- name: Upload coverage
145-
uses: codecov/codecov-action@v3
144+
uses: codecov/codecov-action@v3.1.5
146145
with:
147146
file: ./coverage.xml
148147
flags: GHA_Cygwin

.github/workflows/test-docker.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ jobs:
101101
MATRIX_DOCKER: ${{ matrix.docker }}
102102

103103
- name: Upload coverage
104-
uses: codecov/codecov-action@v3
104+
uses: codecov/codecov-action@v3.1.5
105105
with:
106106
flags: GHA_Docker
107107
name: ${{ matrix.docker }}

.github/workflows/test-mingw.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ jobs:
8282
python3 -m pytest -vx --cov PIL --cov Tests --cov-report term --cov-report xml Tests
8383
8484
- name: Upload coverage
85-
uses: codecov/codecov-action@v3
85+
uses: codecov/codecov-action@v3.1.5
8686
with:
8787
file: ./coverage.xml
8888
flags: GHA_Windows

.github/workflows/test-windows.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ jobs:
202202
shell: pwsh
203203

204204
- name: Upload coverage
205-
uses: codecov/codecov-action@v3
205+
uses: codecov/codecov-action@v3.1.5
206206
with:
207207
file: ./coverage.xml
208208
flags: GHA_Windows

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ jobs:
149149
.ci/after_success.sh
150150
151151
- name: Upload coverage
152-
uses: codecov/codecov-action@v3
152+
uses: codecov/codecov-action@v3.1.5
153153
with:
154154
flags: ${{ matrix.os == 'ubuntu-latest' && 'GHA_Ubuntu' || 'GHA_macOS' }}
155155
name: ${{ matrix.os }} Python ${{ matrix.python-version }}

.github/workflows/wheels-dependencies.sh

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -72,13 +72,11 @@ function build {
7272

7373
build_simple xcb-proto 1.16.0 https://xorg.freedesktop.org/archive/individual/proto
7474
if [ -n "$IS_MACOS" ]; then
75-
if [[ "$CIBW_ARCHS" == "arm64" ]]; then
76-
build_simple xorgproto 2023.2 https://www.x.org/pub/individual/proto
77-
build_simple libXau 1.0.11 https://www.x.org/pub/individual/lib
78-
build_simple libpthread-stubs 0.5 https://xcb.freedesktop.org/dist
79-
if [ -f /Library/Frameworks/Python.framework/Versions/Current/share/pkgconfig/xcb-proto.pc ]; then
80-
cp /Library/Frameworks/Python.framework/Versions/Current/share/pkgconfig/xcb-proto.pc /Library/Frameworks/Python.framework/Versions/Current/lib/pkgconfig/xcb-proto.pc
81-
fi
75+
build_simple xorgproto 2023.2 https://www.x.org/pub/individual/proto
76+
build_simple libXau 1.0.11 https://www.x.org/pub/individual/lib
77+
build_simple libpthread-stubs 0.5 https://xcb.freedesktop.org/dist
78+
if [ -f /Library/Frameworks/Python.framework/Versions/Current/share/pkgconfig/xcb-proto.pc ]; then
79+
cp /Library/Frameworks/Python.framework/Versions/Current/share/pkgconfig/xcb-proto.pc /Library/Frameworks/Python.framework/Versions/Current/lib/pkgconfig/xcb-proto.pc
8280
fi
8381
else
8482
sed s/\${pc_sysrootdir\}// /usr/local/share/pkgconfig/xcb-proto.pc > /usr/local/lib/pkgconfig/xcb-proto.pc
@@ -131,13 +129,13 @@ untar pillow-depends-main.zip
131129

132130
if [[ -n "$IS_MACOS" ]]; then
133131
# webp, libtiff, libxcb cause a conflict with building webp, libtiff, libxcb
134-
# libxdmcp causes an issue on macOS < 11
132+
# libxau and libxdmcp cause an issue on macOS < 11
135133
# if php is installed, brew tries to reinstall these after installing openblas
136134
# remove cairo to fix building harfbuzz on arm64
137135
# remove lcms2 and libpng to fix building openjpeg on arm64
138136
# remove zstd to avoid inclusion on x86_64
139137
# curl from brew requires zstd, use system curl
140-
brew remove --ignore-dependencies webp libpng libtiff libxcb libxdmcp curl php cairo lcms2 ghostscript zstd
138+
brew remove --ignore-dependencies webp libpng libtiff libxcb libxau libxdmcp curl php cairo lcms2 ghostscript zstd
141139

142140
brew install pkg-config
143141
fi

Tests/bench_cffi_access.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,21 +9,21 @@
99
# Not running this test by default. No DOS against CI.
1010

1111

12-
def iterate_get(size, access):
12+
def iterate_get(size, access) -> None:
1313
(w, h) = size
1414
for x in range(w):
1515
for y in range(h):
1616
access[(x, y)]
1717

1818

19-
def iterate_set(size, access):
19+
def iterate_set(size, access) -> None:
2020
(w, h) = size
2121
for x in range(w):
2222
for y in range(h):
2323
access[(x, y)] = (x % 256, y % 256, 0)
2424

2525

26-
def timer(func, label, *args):
26+
def timer(func, label, *args) -> None:
2727
iterations = 5000
2828
starttime = time.time()
2929
for x in range(iterations):
@@ -38,7 +38,7 @@ def timer(func, label, *args):
3838
)
3939

4040

41-
def test_direct():
41+
def test_direct() -> None:
4242
im = hopper()
4343
im.load()
4444
# im = Image.new("RGB", (2000, 2000), (1, 3, 2))

Tests/test_bmp_reference.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@
1010
base = os.path.join("Tests", "images", "bmp")
1111

1212

13-
def get_files(d, ext=".bmp"):
13+
def get_files(d, ext: str = ".bmp"):
1414
return [
1515
os.path.join(base, d, f) for f in os.listdir(os.path.join(base, d)) if ext in f
1616
]
1717

1818

19-
def test_bad():
19+
def test_bad() -> None:
2020
"""These shouldn't crash/dos, but they shouldn't return anything
2121
either"""
2222
for f in get_files("b"):
@@ -56,7 +56,7 @@ def test_questionable():
5656
raise
5757

5858

59-
def test_good():
59+
def test_good() -> None:
6060
"""These should all work. There's a set of target files in the
6161
html directory that we can compare against."""
6262

Tests/test_box_blur.py

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -16,18 +16,18 @@
1616
# fmt: on
1717

1818

19-
def test_imageops_box_blur():
19+
def test_imageops_box_blur() -> None:
2020
i = sample.filter(ImageFilter.BoxBlur(1))
2121
assert i.mode == sample.mode
2222
assert i.size == sample.size
2323
assert isinstance(i, Image.Image)
2424

2525

26-
def box_blur(image, radius=1, n=1):
26+
def box_blur(image, radius: int = 1, n: int = 1):
2727
return image._new(image.im.box_blur((radius, radius), n))
2828

2929

30-
def assert_image(im, data, delta=0):
30+
def assert_image(im, data, delta: int = 0) -> None:
3131
it = iter(im.getdata())
3232
for data_row in data:
3333
im_row = [next(it) for _ in range(im.size[0])]
@@ -37,15 +37,15 @@ def assert_image(im, data, delta=0):
3737
next(it)
3838

3939

40-
def assert_blur(im, radius, data, passes=1, delta=0):
40+
def assert_blur(im, radius, data, passes: int = 1, delta: int = 0) -> None:
4141
# check grayscale image
4242
assert_image(box_blur(im, radius, passes), data, delta)
4343
rgba = Image.merge("RGBA", (im, im, im, im))
4444
for band in box_blur(rgba, radius, passes).split():
4545
assert_image(band, data, delta)
4646

4747

48-
def test_color_modes():
48+
def test_color_modes() -> None:
4949
with pytest.raises(ValueError):
5050
box_blur(sample.convert("1"))
5151
with pytest.raises(ValueError):
@@ -65,7 +65,7 @@ def test_color_modes():
6565
box_blur(sample.convert("YCbCr"))
6666

6767

68-
def test_radius_0():
68+
def test_radius_0() -> None:
6969
assert_blur(
7070
sample,
7171
0,
@@ -81,7 +81,7 @@ def test_radius_0():
8181
)
8282

8383

84-
def test_radius_0_02():
84+
def test_radius_0_02() -> None:
8585
assert_blur(
8686
sample,
8787
0.02,
@@ -98,7 +98,7 @@ def test_radius_0_02():
9898
)
9999

100100

101-
def test_radius_0_05():
101+
def test_radius_0_05() -> None:
102102
assert_blur(
103103
sample,
104104
0.05,
@@ -115,7 +115,7 @@ def test_radius_0_05():
115115
)
116116

117117

118-
def test_radius_0_1():
118+
def test_radius_0_1() -> None:
119119
assert_blur(
120120
sample,
121121
0.1,
@@ -132,7 +132,7 @@ def test_radius_0_1():
132132
)
133133

134134

135-
def test_radius_0_5():
135+
def test_radius_0_5() -> None:
136136
assert_blur(
137137
sample,
138138
0.5,
@@ -149,7 +149,7 @@ def test_radius_0_5():
149149
)
150150

151151

152-
def test_radius_1():
152+
def test_radius_1() -> None:
153153
assert_blur(
154154
sample,
155155
1,
@@ -166,7 +166,7 @@ def test_radius_1():
166166
)
167167

168168

169-
def test_radius_1_5():
169+
def test_radius_1_5() -> None:
170170
assert_blur(
171171
sample,
172172
1.5,
@@ -183,7 +183,7 @@ def test_radius_1_5():
183183
)
184184

185185

186-
def test_radius_bigger_then_half():
186+
def test_radius_bigger_then_half() -> None:
187187
assert_blur(
188188
sample,
189189
3,
@@ -200,7 +200,7 @@ def test_radius_bigger_then_half():
200200
)
201201

202202

203-
def test_radius_bigger_then_width():
203+
def test_radius_bigger_then_width() -> None:
204204
assert_blur(
205205
sample,
206206
10,
@@ -215,7 +215,7 @@ def test_radius_bigger_then_width():
215215
)
216216

217217

218-
def test_extreme_large_radius():
218+
def test_extreme_large_radius() -> None:
219219
assert_blur(
220220
sample,
221221
600,
@@ -230,7 +230,7 @@ def test_extreme_large_radius():
230230
)
231231

232232

233-
def test_two_passes():
233+
def test_two_passes() -> None:
234234
assert_blur(
235235
sample,
236236
1,
@@ -248,7 +248,7 @@ def test_two_passes():
248248
)
249249

250250

251-
def test_three_passes():
251+
def test_three_passes() -> None:
252252
assert_blur(
253253
sample,
254254
1,

0 commit comments

Comments
 (0)