Skip to content

Commit e32bfba

Browse files
committed
Merge branch 'main' into imagegrab_resize
2 parents b36033e + 4337139 commit e32bfba

File tree

94 files changed

+598
-419
lines changed

Some content is hidden

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

94 files changed

+598
-419
lines changed

.github/workflows/lint.yml

Lines changed: 17 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -2,55 +2,31 @@ name: Lint
22

33
on: [push, pull_request, workflow_dispatch]
44

5+
permissions: {}
6+
57
env:
68
FORCE_COLOR: 1
7-
8-
permissions:
9-
contents: read
9+
PREK_COLOR: always
10+
RUFF_OUTPUT_FORMAT: github
1011

1112
concurrency:
1213
group: ${{ github.workflow }}-${{ github.ref }}
1314
cancel-in-progress: true
1415

1516
jobs:
16-
build:
17-
17+
lint:
1818
runs-on: ubuntu-latest
19-
2019
name: Lint
21-
2220
steps:
23-
- uses: actions/checkout@v6
24-
with:
25-
persist-credentials: false
26-
27-
- name: pre-commit cache
28-
uses: actions/cache@v4
29-
with:
30-
path: ~/.cache/pre-commit
31-
key: lint-pre-commit-${{ hashFiles('**/.pre-commit-config.yaml') }}
32-
restore-keys: |
33-
lint-pre-commit-
34-
35-
- name: Set up Python
36-
uses: actions/setup-python@v6
37-
with:
38-
python-version: "3.x"
39-
cache: pip
40-
cache-dependency-path: "setup.py"
41-
42-
- name: Build system information
43-
run: python3 .github/workflows/system-info.py
44-
45-
- name: Install dependencies
46-
run: |
47-
python3 -m pip install -U pip
48-
python3 -m pip install -U tox
49-
50-
- name: Lint
51-
run: tox -e lint
52-
env:
53-
PRE_COMMIT_COLOR: always
54-
55-
- name: Mypy
56-
run: tox -e mypy
21+
- uses: actions/checkout@v6
22+
with:
23+
persist-credentials: false
24+
- uses: actions/setup-python@v6
25+
with:
26+
python-version: "3.10"
27+
- name: Install uv
28+
uses: astral-sh/setup-uv@v7
29+
- name: Lint
30+
run: uvx --with tox-uv tox -e lint
31+
- name: Mypy
32+
run: uvx --with tox-uv tox -e mypy

.github/workflows/test-windows.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,16 @@ env:
3131

3232
jobs:
3333
build:
34-
runs-on: windows-latest
34+
runs-on: ${{ matrix.os }}
3535
strategy:
3636
fail-fast: false
3737
matrix:
3838
python-version: ["pypy3.11", "3.11", "3.12", "3.13", "3.14", "3.15"]
3939
architecture: ["x64"]
40+
os: ["windows-latest"]
4041
include:
4142
# Test the oldest Python on 32-bit
42-
- { python-version: "3.10", architecture: "x86" }
43+
- { python-version: "3.10", architecture: "x86", os: "windows-2022" }
4344

4445
timeout-minutes: 45
4546

@@ -83,7 +84,7 @@ jobs:
8384
python3 -m pip install --upgrade pip
8485
8586
- name: Install CPython dependencies
86-
if: "!contains(matrix.python-version, 'pypy') && !contains(matrix.python-version, '3.14') && matrix.architecture != 'x86'"
87+
if: "!contains(matrix.python-version, 'pypy') && matrix.architecture != 'x86'"
8788
run: |
8889
python3 -m pip install PyQt6
8990

.github/workflows/wheels-dependencies.sh

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -95,19 +95,15 @@ if [[ -n "$IOS_SDK" ]]; then
9595
else
9696
FREETYPE_VERSION=2.14.1
9797
fi
98-
HARFBUZZ_VERSION=12.2.0
98+
HARFBUZZ_VERSION=12.3.0
9999
LIBPNG_VERSION=1.6.53
100-
JPEGTURBO_VERSION=3.1.2
100+
JPEGTURBO_VERSION=3.1.3
101101
OPENJPEG_VERSION=2.5.4
102-
XZ_VERSION=5.8.1
102+
XZ_VERSION=5.8.2
103103
ZSTD_VERSION=1.5.7
104104
TIFF_VERSION=4.7.1
105105
LCMS2_VERSION=2.17
106-
if [[ "$MB_ML_VER" == 2014 ]] && [[ "$PLAT" == "aarch64" ]]; then
107-
ZLIB_NG_VERSION=2.2.5
108-
else
109-
ZLIB_NG_VERSION=2.3.1
110-
fi
106+
ZLIB_NG_VERSION=2.3.2
111107
LIBWEBP_VERSION=1.6.0
112108
BZIP2_VERSION=1.0.8
113109
LIBXCB_VERSION=1.17.0
@@ -150,11 +146,7 @@ function build_zlib_ng {
150146
ORIGINAL_HOST_CONFIGURE_FLAGS=$HOST_CONFIGURE_FLAGS
151147
unset HOST_CONFIGURE_FLAGS
152148

153-
if [[ "$ZLIB_NG_VERSION" == 2.2.5 ]]; then
154-
build_github zlib-ng/zlib-ng $ZLIB_NG_VERSION --zlib-compat
155-
else
156-
build_github zlib-ng/zlib-ng $ZLIB_NG_VERSION --installnamedir=$BUILD_PREFIX/lib --zlib-compat
157-
fi
149+
build_github zlib-ng/zlib-ng $ZLIB_NG_VERSION --installnamedir=$BUILD_PREFIX/lib --zlib-compat
158150

159151
HOST_CONFIGURE_FLAGS=$ORIGINAL_HOST_CONFIGURE_FLAGS
160152
touch zlib-stamp

.github/zizmor.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# Configuration for the zizmor static analysis tool, run via pre-commit in CI
21
# https://docs.zizmor.sh/configuration/
32
rules:
43
obfuscation:

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ repos:
7676
rev: v0.24.1
7777
hooks:
7878
- id: validate-pyproject
79-
additional_dependencies: [trove-classifiers>=2024.10.12]
79+
additional_dependencies: [tomli, trove-classifiers>=2024.10.12]
8080

8181
- repo: https://github.com/tox-dev/tox-ini-fmt
8282
rev: 1.7.0
6.54 KB
Binary file not shown.

Tests/fonts/LICENSE.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
NotoNastaliqUrdu-Regular.ttf and NotoSansSymbols-Regular.ttf, from https://github.com/googlei18n/noto-fonts
33
NotoSans-Regular.ttf, from https://www.google.com/get/noto/
44
NotoSansJP-Thin.otf, from https://www.google.com/get/noto/help/cjk/
5-
AdobeVFPrototype.ttf, from https://github.com/adobe-fonts/adobe-variable-font-prototype
5+
AdobeVFPrototype.ttf, from https://github.com/adobe-fonts/adobe-variable-font-prototype. AdobeVFPrototypeDuplicates.ttf is a modified version of this
66
TINY5x3GX.ttf, from http://velvetyne.fr/fonts/tiny
77
ArefRuqaa-Regular.ttf, from https://github.com/google/fonts/tree/master/ofl/arefruqaa
88
ter-x20b.pcf, from http://terminus-font.sourceforge.net/

Tests/helper.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@ def convert_to_comparable(
5555
if a.mode == "P":
5656
new_a = Image.new("L", a.size)
5757
new_b = Image.new("L", b.size)
58-
new_a.putdata(a.getdata())
59-
new_b.putdata(b.getdata())
58+
new_a.putdata(a.get_flattened_data())
59+
new_b.putdata(b.get_flattened_data())
6060
elif a.mode == "I;16":
6161
new_a = a.convert("I")
6262
new_b = b.convert("I")
@@ -104,10 +104,9 @@ def assert_image_equal_tofile(
104104
msg: str | None = None,
105105
mode: str | None = None,
106106
) -> None:
107-
with Image.open(filename) as img:
108-
if mode:
109-
img = img.convert(mode)
110-
assert_image_equal(a, img, msg)
107+
with Image.open(filename) as im:
108+
converted_im = im.convert(mode) if mode else im
109+
assert_image_equal(a, converted_im, msg)
111110

112111

113112
def assert_image_similar(

Tests/images/morph_a.png

-4 Bytes
Loading

Tests/test_bmp_reference.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -95,16 +95,16 @@ def get_compare(f: str) -> str:
9595
for f in get_files("g"):
9696
try:
9797
with Image.open(f) as im:
98-
im.load()
9998
with Image.open(get_compare(f)) as compare:
100-
compare.load()
101-
if im.mode == "P":
102-
# assert image similar doesn't really work
103-
# with paletized image, since the palette might
104-
# be differently ordered for an equivalent image.
105-
im = im.convert("RGBA")
106-
compare = compare.convert("RGBA")
107-
assert_image_similar(im, compare, 5)
99+
# assert image similar doesn't really work
100+
# with paletized image, since the palette might
101+
# be differently ordered for an equivalent image.
102+
im_converted = im.convert("RGBA") if im.mode == "P" else im
103+
compare_converted = (
104+
compare.convert("RGBA") if im.mode == "P" else compare
105+
)
106+
107+
assert_image_similar(im_converted, compare_converted, 5)
108108

109109
except Exception as msg:
110110
# there are three here that are unsupported:

0 commit comments

Comments
 (0)