Skip to content

Commit 8780772

Browse files
committed
Merge branch 'main' into build
2 parents 18da2d0 + 9a560c7 commit 8780772

15 files changed

Lines changed: 73 additions & 26 deletions

.ci/install.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ set -e
2222
if [[ $(uname) != CYGWIN* ]]; then
2323
sudo apt-get -qq install libfreetype6-dev liblcms2-dev python3-tk\
2424
ghostscript libffi-dev libjpeg-turbo-progs libopenjp2-7-dev\
25-
cmake meson imagemagick libharfbuzz-dev libfribidi-dev
25+
cmake meson imagemagick libharfbuzz-dev libfribidi-dev\
26+
sway wl-clipboard
2627
fi
2728

2829
python3 -m pip install --upgrade pip
@@ -41,7 +42,7 @@ if [[ $(uname) != CYGWIN* ]]; then
4142
if ! [ "$GHA_PYTHON_VERSION" == "3.12-dev" ]; then python3 -m pip install numpy ; fi
4243

4344
# PyQt6 doesn't support PyPy3
44-
if [[ $GHA_PYTHON_VERSION == 3.* ]]; then
45+
if [[ "$GHA_PYTHON_VERSION" != "3.12-dev" && $GHA_PYTHON_VERSION == 3.* ]]; then
4546
sudo apt-get -qq install libegl1 libxcb-cursor0 libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-randr0 libxcb-render-util0 libxcb-shape0 libxkbcommon-x11-0
4647
python3 -m pip install pyqt6
4748
fi

.editorconfig

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,6 @@ indent_style = space
1313

1414
trim_trailing_whitespace = true
1515

16-
[*.rst]
17-
# Four-space indentation
18-
indent_size = 4
19-
2016
[*.yml]
2117
# Two-space indentation
2218
indent_size = 2

.github/workflows/test-windows.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,8 @@ jobs:
6565
- name: Print build system information
6666
run: python3 .github/workflows/system-info.py
6767

68-
- name: python3 -m pip install wheel pytest pytest-cov pytest-timeout defusedxml
69-
run: python3 -m pip install wheel pytest pytest-cov pytest-timeout defusedxml
68+
- name: python3 -m pip install setuptools wheel pytest pytest-cov pytest-timeout defusedxml
69+
run: python3 -m pip install setuptools wheel pytest pytest-cov pytest-timeout defusedxml
7070

7171
- name: Install dependencies
7272
id: install

.github/workflows/test.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,9 @@ jobs:
8484
python3 -m pip install pytest-reverse
8585
fi
8686
if [ "${{ matrix.os }}" = "ubuntu-latest" ]; then
87-
xvfb-run -s '-screen 0 1024x768x24' .ci/test.sh
87+
xvfb-run -s '-screen 0 1024x768x24' sway&
88+
export WAYLAND_DISPLAY=wayland-1
89+
.ci/test.sh
8890
else
8991
.ci/test.sh
9092
fi

.pre-commit-config.yaml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@ repos:
44
hooks:
55
- id: black
66
args: [--target-version=py38]
7-
# Only .py files, until https://github.com/psf/black/issues/402 resolved
8-
files: \.py$
9-
types: []
107

118
- repo: https://github.com/PyCQA/isort
129
rev: 5.12.0

CHANGES.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ Changelog (Pillow)
55
10.0.0 (unreleased)
66
-------------------
77

8+
- Improved wl-paste mimetype handling in ImageGrab #7094
9+
[rrcgat, radarhere]
10+
811
- Added _repr_jpeg_() for IPython display_jpeg #7135
912
[n3011, radarhere, nulano]
1013

Tests/test_imagegrab.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,3 +98,18 @@ def test_grabclipboard_png(self):
9898

9999
im = ImageGrab.grabclipboard()
100100
assert_image_equal_tofile(im, "Tests/images/hopper.png")
101+
102+
@pytest.mark.skipif(
103+
(
104+
sys.platform != "linux"
105+
or not all(shutil.which(cmd) for cmd in ("wl-paste", "wl-copy"))
106+
),
107+
reason="Linux with wl-clipboard only",
108+
)
109+
@pytest.mark.parametrize("ext", ("gif", "png", "ico"))
110+
def test_grabclipboard_wl_clipboard(self, ext):
111+
image_path = "Tests/images/hopper." + ext
112+
with open(image_path, "rb") as fp:
113+
subprocess.call(["wl-copy"], stdin=fp)
114+
im = ImageGrab.grabclipboard()
115+
assert_image_equal_tofile(im, image_path)

codecov.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
# Documentation: https://docs.codecov.io/docs/codecov-yaml
1+
# Documentation: https://docs.codecov.com/docs/codecov-yaml
22

33
codecov:
44
# Avoid "Missing base report" due to committing CHANGES.rst with "[CI skip]"
55
# https://github.com/codecov/support/issues/363
6-
# https://docs.codecov.io/docs/comparing-commits
6+
# https://docs.codecov.com/docs/comparing-commits
77
allow_coverage_offsets: true
88

99
comment: false

docs/Guardfile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
from livereload.compiler import shell
33
from livereload.task import Task
44

5-
Task.add('*.rst', shell('make html'))
6-
Task.add('*/*.rst', shell('make html'))
7-
Task.add('Makefile', shell('make html'))
8-
Task.add('conf.py', shell('make html'))
5+
Task.add("*.rst", shell("make html"))
6+
Task.add("*/*.rst", shell("make html"))
7+
Task.add("Makefile", shell("make html"))
8+
Task.add("conf.py", shell("make html"))

src/PIL/IcnsImagePlugin.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@
2222
import struct
2323
import sys
2424

25-
from PIL import Image, ImageFile, PngImagePlugin, features
25+
from . import Image, ImageFile, PngImagePlugin, features
2626

2727
enable_jpeg2k = features.check_codec("jpg_2000")
2828
if enable_jpeg2k:
29-
from PIL import Jpeg2KImagePlugin
29+
from . import Jpeg2KImagePlugin
3030

3131
MAGIC = b"icns"
3232
HEADERSIZE = 8

0 commit comments

Comments
 (0)