Skip to content

Commit 94bc5ba

Browse files
authored
Merge branch 'main' into feat/riscv64-wheels
2 parents 4e7a572 + 270dc69 commit 94bc5ba

57 files changed

Lines changed: 246 additions & 247 deletions

Some content is hidden

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

.ci/install.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ python3 -m pip install olefile
3131
python3 -m pip install -U pytest
3232
python3 -m pip install -U pytest-cov
3333
python3 -m pip install -U pytest-timeout
34-
python3 -m pip install pyroma
3534
# optional test dependencies, only install if there's a binary package.
3635
python3 -m pip install --only-binary=:all: numpy || true
3736
python3 -m pip install --only-binary=:all: pyarrow || true

.ci/requirements-mypy.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
mypy==1.20.2
1+
mypy==2.1.0
22
arro3-compute
33
arro3-core
44
IceSpringPySideStubs-PyQt6

.github/workflows/macos-install.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ python3 -m pip install olefile
1212
python3 -m pip install -U pytest
1313
python3 -m pip install -U pytest-cov
1414
python3 -m pip install -U pytest-timeout
15-
python3 -m pip install pyroma
1615
# optional test dependencies, only install if there's a binary package.
1716
python3 -m pip install --only-binary=:all: numpy || true
1817
python3 -m pip install --only-binary=:all: pyarrow || true

.github/workflows/wheels.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,7 @@ jobs:
137137
CIBW_ARCHS: ${{ matrix.cibw_arch }}
138138
CIBW_BUILD: ${{ matrix.build }}
139139
CIBW_ENABLE: cpython-prerelease pypy
140+
CIBW_ENVIRONMENT_PASS_LINUX: FORCE_COLOR
140141
CIBW_MANYLINUX_RISCV64_IMAGE: ${{ matrix.manylinux }}
141142
MACOSX_DEPLOYMENT_TARGET: ${{ matrix.macosx_deployment_target }}
142143

@@ -214,7 +215,7 @@ jobs:
214215
-v {project}:C:\pillow
215216
-v C:\cibw:C:\cibw
216217
-v %CD%\..\venv-test:%CD%\..\venv-test
217-
-e CI -e GITHUB_ACTIONS
218+
-e CI -e GITHUB_ACTIONS -e FORCE_COLOR
218219
mcr.microsoft.com/windows/servercore:ltsc2022
219220
powershell C:\pillow\.github\workflows\wheels-test.ps1 %CD%\..\venv-test'
220221
shell: bash

.pre-commit-config.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,13 @@ repos:
8686
hooks:
8787
- id: tox-ini-fmt
8888

89+
- repo: https://github.com/regebro/pyroma
90+
rev: 5.0.1
91+
hooks:
92+
- id: pyroma
93+
additional_dependencies: [check-manifest]
94+
stages: [manual]
95+
8996
- repo: meta
9097
hooks:
9198
- id: check-hooks-apply

Makefile

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,6 @@ release-test:
8181
python3 -m pytest Tests
8282
python3 -m pip install .
8383
python3 -m pytest -qq
84-
python3 -m check_manifest
85-
python3 -m pyroma .
8684
$(MAKE) readme
8785

8886
.PHONY: sdist

Tests/test_file_jpeg.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1053,9 +1053,7 @@ def test_eof(self, monkeypatch: pytest.MonkeyPatch) -> None:
10531053
# Even though this decoder never says that it is finished
10541054
# the image should still end when there is no new data
10551055
class InfiniteMockPyDecoder(ImageFile.PyDecoder):
1056-
def decode(
1057-
self, buffer: bytes | Image.SupportsArrayInterface
1058-
) -> tuple[int, int]:
1056+
def decode(self, buffer: Image.DecoderInput) -> tuple[int, int]:
10591057
return 0, 0
10601058

10611059
Image.register_decoder("INFINITE", InfiniteMockPyDecoder)

Tests/test_file_pdf.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@ def helper_save_as_pdf(tmp_path: Path, mode: str, **kwargs: Any) -> str:
4040
with open(outfile, "rb") as fp:
4141
contents = fp.read()
4242
size = tuple(
43-
float(d) for d in contents.split(b"/MediaBox [ 0 0 ")[1].split(b"]")[0].split()
43+
int(float(d))
44+
for d in contents.split(b"/MediaBox [ 0 0 ")[1].split(b"]")[0].split()
4445
)
4546
assert im.size == size
4647

Tests/test_file_png.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,14 @@ def test_broken(self) -> None:
124124
with Image.open(test_file):
125125
pass
126126

127+
def test_ihdr_unknown_mode(self) -> None:
128+
fp = BytesIO(chunk(b"IHDR", b"\x00" * 13))
129+
with PngImagePlugin.PngStream(fp) as png:
130+
cid, pos, length = png.read()
131+
png.call(cid, pos, length)
132+
133+
assert png.im_mode == ""
134+
127135
def test_bad_text(self) -> None:
128136
# Make sure PIL can read malformed tEXt chunks (@PIL152)
129137

Tests/test_format_lab.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ def test_white() -> None:
1919

2020
assert k == (255, 128, 128)
2121

22-
assert L == (255,) * 100
23-
assert a == (128,) * 100
24-
assert b == (128,) * 100
22+
assert L == (255.0,) * 100
23+
assert a == (128.0,) * 100
24+
assert b == (128.0,) * 100
2525

2626

2727
def test_green() -> None:

0 commit comments

Comments
 (0)