File tree Expand file tree Collapse file tree 10 files changed +88
-14
lines changed Expand file tree Collapse file tree 10 files changed +88
-14
lines changed Original file line number Diff line number Diff line change @@ -34,12 +34,10 @@ python3 -m pip install pyroma
3434python3 -m pip install test-image-results
3535python3 -m pip install numpy
3636
37- # PyQt5 doesn't support PyPy3
37+ # PyQt6 doesn't support PyPy3
3838if [[ $GHA_PYTHON_VERSION == 3.* ]]; then
39- # arm64, ppc64le, s390x CPUs:
40- # "ERROR: Could not find a version that satisfies the requirement pyqt5"
41- sudo apt-get -qq install libxcb-xinerama0 pyqt5-dev-tools
42- python3 -m pip install pyqt5
39+ sudo apt-get -qq install libegl1 libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-randr0 libxcb-render-util0 libxkbcommon-x11-0
40+ python3 -m pip install pyqt6
4341fi
4442
4543# webp
Original file line number Diff line number Diff line change 1+ import warnings
2+
3+ with warnings .catch_warnings (record = True ) as w :
4+ # Arrange: cause all warnings to always be triggered
5+ warnings .simplefilter ("always" )
6+
7+ # Act: trigger a warning with Qt5
8+ from PIL import ImageQt
9+
10+
11+ def test_deprecated ():
12+ # Assert
13+ if ImageQt .qt_version in ("5" , "side2" ):
14+ assert len (w ) == 1
15+ assert issubclass (w [0 ].category , DeprecationWarning )
16+ assert "deprecated" in str (w [0 ].message )
17+ else :
18+ assert len (w ) == 0
Original file line number Diff line number Diff line change 1+ import warnings
2+
13import pytest
24
3- from PIL import Image , ImageQt
5+ from PIL import Image
6+
7+ with warnings .catch_warnings ():
8+ warnings .simplefilter ("ignore" , category = DeprecationWarning )
9+ from PIL import ImageQt
410
511from .helper import assert_image_equal , hopper
612
Original file line number Diff line number Diff line change 22
33import pytest
44
5- from PIL import ImageQt
6-
75from .helper import assert_image_similar , hopper
86
7+ with warnings .catch_warnings () as w :
8+ warnings .simplefilter ("ignore" , category = DeprecationWarning )
9+ from PIL import ImageQt
10+
11+
912pytestmark = pytest .mark .skipif (
1013 not ImageQt .qt_is_installed , reason = "Qt bindings are not installed"
1114)
Original file line number Diff line number Diff line change 1+ import warnings
2+
13import pytest
24
3- from PIL import ImageQt
5+ with warnings .catch_warnings ():
6+ warnings .simplefilter ("ignore" , category = DeprecationWarning )
7+ from PIL import ImageQt
48
59from .helper import assert_image_equal , assert_image_equal_tofile , hopper
610
Original file line number Diff line number Diff line change 1+ import warnings
2+
13import pytest
24
3- from PIL import ImageQt
5+ with warnings .catch_warnings ():
6+ warnings .simplefilter ("ignore" , category = DeprecationWarning )
7+ from PIL import ImageQt
48
59from .helper import assert_image_equal , assert_image_equal_tofile , hopper
610
Original file line number Diff line number Diff line change @@ -142,20 +142,33 @@ The stub image plugin ``FitsStubImagePlugin`` has been deprecated and will be re
142142Pillow 10.0.0 (2023-07-01). FITS images can be read without a handler through
143143:mod: `~PIL.FitsImagePlugin ` instead.
144144
145+ FreeTypeFont.getmask2 fill parameter
146+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
147+
148+ .. deprecated :: 9.2.0
149+
150+ The undocumented ``fill `` parameter of :py:meth: `.FreeTypeFont.getmask2 ` has been
151+ deprecated and will be removed in Pillow 10 (2023-07-01).
152+
145153PhotoImage.paste box parameter
146154~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
147155
148156.. deprecated :: 9.2.0
149157
150158The ``box `` parameter is unused. It will be removed in Pillow 10.0.0 (2023-07-01).
151159
152- FreeTypeFont.getmask2 fill parameter
153- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
160+ PyQt5 and PySide2
161+ ~~~~~~~~~~~~~~~~~
154162
155163.. deprecated :: 9.2.0
156164
157- The undocumented ``fill `` parameter of :py:meth: `.FreeTypeFont.getmask2 ` has been
158- deprecated and will be removed in Pillow 10 (2023-07-01).
165+ `Qt 5 reached end-of-life <https://www.qt.io/blog/qt-5.15-released >`_ on 2020-12-08 for
166+ open-source users (and will reach EOL on 2023-12-08 for commercial licence holders).
167+
168+ Support for PyQt5 and PySide2 has been deprecated from ``ImageQt `` and will be removed
169+ in Pillow 10 (2023-07-01). Upgrade to
170+ `PyQt6 <https://www.riverbankcomputing.com/static/Docs/PyQt6/ >`_ or
171+ `PySide6 <https://doc.qt.io/qtforpython/ >`_ instead.
159172
160173Removed features
161174----------------
Original file line number Diff line number Diff line change 77The :py:mod: `~PIL.ImageQt ` module contains support for creating PyQt6, PySide6, PyQt5
88or PySide2 QImage objects from PIL images.
99
10+ `Qt 5 reached end-of-life <https://www.qt.io/blog/qt-5.15-released >`_ on 2020-12-08 for
11+ open-source users (and will reach EOL on 2023-12-08 for commercial licence holders).
12+
13+ Support for PyQt5 and PySide2 has been deprecated from ``ImageQt `` and will be removed
14+ in Pillow 10 (2023-07-01). Upgrade to
15+ `PyQt6 <https://www.riverbankcomputing.com/static/Docs/PyQt6/ >`_ or
16+ `PySide6 <https://doc.qt.io/qtforpython/ >`_ instead.
17+
1018.. versionadded :: 1.1.6
1119
1220.. py :class :: ImageQt(image)
Original file line number Diff line number Diff line change 1010Deprecations
1111============
1212
13+ PyQt5 and PySide2
14+ ^^^^^^^^^^^^^^^^^
15+
16+ .. deprecated :: 9.2.0
17+
18+ `Qt 5 reached end-of-life <https://www.qt.io/blog/qt-5.15-released >`_ on 2020-12-08 for
19+ open-source users (and will reach EOL on 2023-12-08 for commercial licence holders).
20+
21+ Support for PyQt5 and PySide2 has been deprecated from ``ImageQt `` and will be removed
22+ in Pillow 10 (2023-07-01). Upgrade to
23+ `PyQt6 <https://www.riverbankcomputing.com/static/Docs/PyQt6/ >`_ or
24+ `PySide6 <https://doc.qt.io/qtforpython/ >`_ instead.
25+
1326FreeTypeFont.getmask2 fill parameter
1427^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1528
29+ .. deprecated :: 9.2.0
30+
1631The undocumented ``fill `` parameter of :py:meth: `.FreeTypeFont.getmask2 `
1732has been deprecated and will be removed in Pillow 10 (2023-07-01).
1833
Original file line number Diff line number Diff line change 2020from io import BytesIO
2121
2222from . import Image
23+ from ._deprecate import deprecate
2324from ._util import is_path
2425
2526qt_versions = [
4243 elif qt_module == "PyQt5" :
4344 from PyQt5 .QtCore import QBuffer , QIODevice
4445 from PyQt5 .QtGui import QImage , QPixmap , qRgba
46+
47+ deprecate ("Support for PyQt5" , 10 , "PyQt6 or PySide6" )
4548 elif qt_module == "PySide2" :
4649 from PySide2 .QtCore import QBuffer , QIODevice
4750 from PySide2 .QtGui import QImage , QPixmap , qRgba
51+
52+ deprecate ("Support for PySide2" , 10 , "PyQt6 or PySide6" )
4853 except (ImportError , RuntimeError ):
4954 continue
5055 qt_is_installed = True
You can’t perform that action at this time.
0 commit comments