Skip to content

Commit 585bd6a

Browse files
authored
Merge pull request #8182 from hugovk/rm-deprecated-psfile
Remove PSFile, PyAccess and USE_CFFI_ACCESS
2 parents a3a6198 + 4ab4fa4 commit 585bd6a

26 files changed

+115
-802
lines changed

.ci/install.sh

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,6 @@ fi
2828

2929
python3 -m pip install --upgrade pip
3030
python3 -m pip install --upgrade wheel
31-
# TODO Update condition when cffi supports 3.13
32-
if ! [[ "$GHA_PYTHON_VERSION" == "3.13" ]]; then PYTHONOPTIMIZE=0 python3 -m pip install cffi ; fi
3331
python3 -m pip install coverage
3432
python3 -m pip install defusedxml
3533
python3 -m pip install olefile

.coveragerc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,5 @@ exclude_also =
1919
[run]
2020
omit =
2121
Tests/32bit_segfault_check.py
22-
Tests/bench_cffi_access.py
2322
Tests/check_*.py
2423
Tests/createfontdatachunk.py

.github/workflows/macos-install.sh

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,6 @@ else
1818
fi
1919
export PKG_CONFIG_PATH="/usr/local/opt/openblas/lib/pkgconfig"
2020

21-
# TODO Update condition when cffi supports 3.13
22-
if ! [[ "$GHA_PYTHON_VERSION" == "3.13" ]]; then PYTHONOPTIMIZE=0 python3 -m pip install cffi ; fi
23-
2421
python3 -m pip install coverage
2522
python3 -m pip install defusedxml
2623
python3 -m pip install olefile

.github/workflows/test-cygwin.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@ jobs:
7272
make
7373
netpbm
7474
perl
75-
python3${{ matrix.python-minor-version }}-cffi
7675
python3${{ matrix.python-minor-version }}-cython
7776
python3${{ matrix.python-minor-version }}-devel
7877
python3${{ matrix.python-minor-version }}-numpy

.github/workflows/test-mingw.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@ jobs:
6464
mingw-w64-x86_64-libtiff \
6565
mingw-w64-x86_64-libwebp \
6666
mingw-w64-x86_64-openjpeg2 \
67-
mingw-w64-x86_64-python3-cffi \
6867
mingw-w64-x86_64-python3-numpy \
6968
mingw-w64-x86_64-python3-olefile \
7069
mingw-w64-x86_64-python3-setuptools \

Tests/bench_cffi_access.py

Lines changed: 0 additions & 54 deletions
This file was deleted.

Tests/test_deprecate.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99
"version, expected",
1010
[
1111
(
12-
11,
13-
"Old thing is deprecated and will be removed in Pillow 11 "
14-
r"\(2024-10-15\)\. Use new thing instead\.",
12+
12,
13+
"Old thing is deprecated and will be removed in Pillow 12 "
14+
r"\(2025-10-15\)\. Use new thing instead\.",
1515
),
1616
(
1717
None,
@@ -54,18 +54,18 @@ def test_old_version(deprecated: str, plural: bool, expected: str) -> None:
5454

5555
def test_plural() -> None:
5656
expected = (
57-
r"Old things are deprecated and will be removed in Pillow 11 \(2024-10-15\)\. "
57+
r"Old things are deprecated and will be removed in Pillow 12 \(2025-10-15\)\. "
5858
r"Use new thing instead\."
5959
)
6060
with pytest.warns(DeprecationWarning, match=expected):
61-
_deprecate.deprecate("Old things", 11, "new thing", plural=True)
61+
_deprecate.deprecate("Old things", 12, "new thing", plural=True)
6262

6363

6464
def test_replacement_and_action() -> None:
6565
expected = "Use only one of 'replacement' and 'action'"
6666
with pytest.raises(ValueError, match=expected):
6767
_deprecate.deprecate(
68-
"Old thing", 11, replacement="new thing", action="Upgrade to new thing"
68+
"Old thing", 12, replacement="new thing", action="Upgrade to new thing"
6969
)
7070

7171

@@ -78,16 +78,16 @@ def test_replacement_and_action() -> None:
7878
)
7979
def test_action(action: str) -> None:
8080
expected = (
81-
r"Old thing is deprecated and will be removed in Pillow 11 \(2024-10-15\)\. "
81+
r"Old thing is deprecated and will be removed in Pillow 12 \(2025-10-15\)\. "
8282
r"Upgrade to new thing\."
8383
)
8484
with pytest.warns(DeprecationWarning, match=expected):
85-
_deprecate.deprecate("Old thing", 11, action=action)
85+
_deprecate.deprecate("Old thing", 12, action=action)
8686

8787

8888
def test_no_replacement_or_action() -> None:
8989
expected = (
90-
r"Old thing is deprecated and will be removed in Pillow 11 \(2024-10-15\)"
90+
r"Old thing is deprecated and will be removed in Pillow 12 \(2025-10-15\)"
9191
)
9292
with pytest.warns(DeprecationWarning, match=expected):
93-
_deprecate.deprecate("Old thing", 11)
93+
_deprecate.deprecate("Old thing", 12)

Tests/test_file_eps.py

Lines changed: 0 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -329,46 +329,6 @@ def test_read_binary_preview() -> None:
329329
pass
330330

331331

332-
def test_readline_psfile(tmp_path: Path) -> None:
333-
# check all the freaking line endings possible from the spec
334-
# test_string = u'something\r\nelse\n\rbaz\rbif\n'
335-
line_endings = ["\r\n", "\n", "\n\r", "\r"]
336-
strings = ["something", "else", "baz", "bif"]
337-
338-
def _test_readline(t: EpsImagePlugin.PSFile, ending: str) -> None:
339-
ending = f"Failure with line ending: {''.join(str(ord(s)) for s in ending)}"
340-
assert t.readline().strip("\r\n") == "something", ending
341-
assert t.readline().strip("\r\n") == "else", ending
342-
assert t.readline().strip("\r\n") == "baz", ending
343-
assert t.readline().strip("\r\n") == "bif", ending
344-
345-
def _test_readline_io_psfile(test_string: str, ending: str) -> None:
346-
f = io.BytesIO(test_string.encode("latin-1"))
347-
with pytest.warns(DeprecationWarning):
348-
t = EpsImagePlugin.PSFile(f)
349-
_test_readline(t, ending)
350-
351-
def _test_readline_file_psfile(test_string: str, ending: str) -> None:
352-
f = str(tmp_path / "temp.txt")
353-
with open(f, "wb") as w:
354-
w.write(test_string.encode("latin-1"))
355-
356-
with open(f, "rb") as r:
357-
with pytest.warns(DeprecationWarning):
358-
t = EpsImagePlugin.PSFile(r)
359-
_test_readline(t, ending)
360-
361-
for ending in line_endings:
362-
s = ending.join(strings)
363-
_test_readline_io_psfile(s, ending)
364-
_test_readline_file_psfile(s, ending)
365-
366-
367-
def test_psfile_deprecation() -> None:
368-
with pytest.warns(DeprecationWarning):
369-
EpsImagePlugin.PSFile(None)
370-
371-
372332
@pytest.mark.parametrize("prefix", (b"", simple_binary_header))
373333
@pytest.mark.parametrize(
374334
"line_ending",

0 commit comments

Comments
 (0)