Skip to content

Commit 92eb11e

Browse files
authored
Merge pull request #8729 from python-pillow/pre-commit-ci-update-config
[pre-commit.ci] pre-commit autoupdate
2 parents 4d1f874 + 00790e9 commit 92eb11e

24 files changed

+98
-99
lines changed

.pre-commit-config.yaml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
repos:
22
- repo: https://github.com/astral-sh/ruff-pre-commit
3-
rev: v0.8.6
3+
rev: v0.9.4
44
hooks:
55
- id: ruff
66
args: [--exit-non-zero-on-fix]
77

88
- repo: https://github.com/psf/black-pre-commit-mirror
9-
rev: 24.10.0
9+
rev: 25.1.0
1010
hooks:
1111
- id: black
1212

1313
- repo: https://github.com/PyCQA/bandit
14-
rev: 1.8.0
14+
rev: 1.8.2
1515
hooks:
1616
- id: bandit
1717
args: [--severity-level=high]
@@ -24,7 +24,7 @@ repos:
2424
exclude: (Makefile$|\.bat$|\.cmake$|\.eps$|\.fits$|\.gd$|\.opt$)
2525

2626
- repo: https://github.com/pre-commit/mirrors-clang-format
27-
rev: v19.1.6
27+
rev: v19.1.7
2828
hooks:
2929
- id: clang-format
3030
types: [c]
@@ -50,14 +50,14 @@ repos:
5050
exclude: ^.github/.*TEMPLATE|^Tests/(fonts|images)/
5151

5252
- repo: https://github.com/python-jsonschema/check-jsonschema
53-
rev: 0.30.0
53+
rev: 0.31.1
5454
hooks:
5555
- id: check-github-workflows
5656
- id: check-readthedocs
5757
- id: check-renovate
5858

5959
- repo: https://github.com/woodruffw/zizmor-pre-commit
60-
rev: v1.0.0
60+
rev: v1.3.0
6161
hooks:
6262
- id: zizmor
6363

@@ -78,7 +78,7 @@ repos:
7878
additional_dependencies: [trove-classifiers>=2024.10.12]
7979

8080
- repo: https://github.com/tox-dev/tox-ini-fmt
81-
rev: 1.4.1
81+
rev: 1.5.0
8282
hooks:
8383
- id: tox-ini-fmt
8484

Tests/test_file_jpeg.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -934,7 +934,7 @@ def test_icc_after_SOF(self) -> None:
934934

935935
def test_jpeg_magic_number(self, monkeypatch: pytest.MonkeyPatch) -> None:
936936
size = 4097
937-
buffer = BytesIO(b"\xFF" * size) # Many xFF bytes
937+
buffer = BytesIO(b"\xff" * size) # Many xff bytes
938938
max_pos = 0
939939
orig_read = buffer.read
940940

Tests/test_file_libtiff.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ class Tc(NamedTuple):
309309
}
310310

311311
def check_tags(
312-
tiffinfo: TiffImagePlugin.ImageFileDirectory_v2 | dict[int, str]
312+
tiffinfo: TiffImagePlugin.ImageFileDirectory_v2 | dict[int, str],
313313
) -> None:
314314
im = hopper()
315315

Tests/test_file_pdf.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ def test_pdf_append(tmp_path: Path) -> None:
264264
# append some info
265265
pdf.info.Title = "abc"
266266
pdf.info.Author = "def"
267-
pdf.info.Subject = "ghi\uABCD"
267+
pdf.info.Subject = "ghi\uabcd"
268268
pdf.info.Keywords = "qw)e\\r(ty"
269269
pdf.info.Creator = "hopper()"
270270
pdf.start_writing()
@@ -292,7 +292,7 @@ def test_pdf_append(tmp_path: Path) -> None:
292292
assert pdf.info.Title == "abc"
293293
assert pdf.info.Producer == "PdfParser"
294294
assert pdf.info.Keywords == "qw)e\\r(ty"
295-
assert pdf.info.Subject == "ghi\uABCD"
295+
assert pdf.info.Subject == "ghi\uabcd"
296296
assert b"CreationDate" in pdf.info
297297
assert b"ModDate" in pdf.info
298298
check_pdf_pages_consistency(pdf)

Tests/test_file_ppm.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ def test_sanity() -> None:
4949
(b"P5 3 1 257 \x00\x00\x00\x80\x01\x01", "I", (0, 32640, 65535)),
5050
# P6 with maxval < 255
5151
(
52-
b"P6 3 1 17 \x00\x01\x02\x08\x09\x0A\x0F\x10\x11",
52+
b"P6 3 1 17 \x00\x01\x02\x08\x09\x0a\x0f\x10\x11",
5353
"RGB",
5454
(
5555
(0, 15, 30),
@@ -60,7 +60,7 @@ def test_sanity() -> None:
6060
# P6 with maxval > 255
6161
(
6262
b"P6 3 1 257 \x00\x00\x00\x01\x00\x02"
63-
b"\x00\x80\x00\x81\x00\x82\x01\x00\x01\x01\xFF\xFF",
63+
b"\x00\x80\x00\x81\x00\x82\x01\x00\x01\x01\xff\xff",
6464
"RGB",
6565
(
6666
(0, 1, 2),

Tests/test_file_tiff.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -746,7 +746,7 @@ def im_generator(ims: list[Image.Image]) -> Generator[Image.Image, None, None]:
746746
assert reread.n_frames == 3
747747

748748
def test_fixoffsets(self) -> None:
749-
b = BytesIO(b"II\x2A\x00\x00\x00\x00\x00")
749+
b = BytesIO(b"II\x2a\x00\x00\x00\x00\x00")
750750
with TiffImagePlugin.AppendingTiffWriter(b) as a:
751751
b.seek(0)
752752
a.fixOffsets(1, isShort=True)
@@ -759,14 +759,14 @@ def test_fixoffsets(self) -> None:
759759
with pytest.raises(RuntimeError):
760760
a.fixOffsets(1)
761761

762-
b = BytesIO(b"II\x2A\x00\x00\x00\x00\x00")
762+
b = BytesIO(b"II\x2a\x00\x00\x00\x00\x00")
763763
with TiffImagePlugin.AppendingTiffWriter(b) as a:
764764
a.offsetOfNewPage = 2**16
765765

766766
b.seek(0)
767767
a.fixOffsets(1, isShort=True)
768768

769-
b = BytesIO(b"II\x2B\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00")
769+
b = BytesIO(b"II\x2b\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00")
770770
with TiffImagePlugin.AppendingTiffWriter(b) as a:
771771
a.offsetOfNewPage = 2**32
772772

@@ -777,15 +777,15 @@ def test_fixoffsets(self) -> None:
777777
a.fixOffsets(1, isLong=True)
778778

779779
def test_appending_tiff_writer_writelong(self) -> None:
780-
data = b"II\x2A\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
780+
data = b"II\x2a\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
781781
b = BytesIO(data)
782782
with TiffImagePlugin.AppendingTiffWriter(b) as a:
783783
a.seek(-4, os.SEEK_CUR)
784784
a.writeLong(2**32 - 1)
785785
assert b.getvalue() == data[:-4] + b"\xff\xff\xff\xff"
786786

787787
def test_appending_tiff_writer_rewritelastshorttolong(self) -> None:
788-
data = b"II\x2A\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
788+
data = b"II\x2a\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
789789
b = BytesIO(data)
790790
with TiffImagePlugin.AppendingTiffWriter(b) as a:
791791
a.seek(-2, os.SEEK_CUR)

Tests/test_file_wmf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ def test_load_float_dpi() -> None:
7171

7272
with open("Tests/images/drawing.emf", "rb") as fp:
7373
data = fp.read()
74-
b = BytesIO(data[:8] + b"\x06\xFA" + data[10:])
74+
b = BytesIO(data[:8] + b"\x06\xfa" + data[10:])
7575
with Image.open(b) as im:
7676
assert im.info["dpi"][0] == 2540
7777

Tests/test_imagedraw.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -812,7 +812,7 @@ def test_rounded_rectangle(
812812
tuple[int, int, int, int]
813813
| tuple[list[int]]
814814
| tuple[tuple[int, int], tuple[int, int]]
815-
)
815+
),
816816
) -> None:
817817
# Arrange
818818
im = Image.new("RGB", (200, 200))

Tests/test_imagefont.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -557,7 +557,7 @@ def test_render_empty(font: ImageFont.FreeTypeFont) -> None:
557557

558558
def test_unicode_extended(layout_engine: ImageFont.Layout) -> None:
559559
# issue #3777
560-
text = "A\u278A\U0001F12B"
560+
text = "A\u278a\U0001f12b"
561561
target = "Tests/images/unicode_extended.png"
562562

563563
ttf = ImageFont.truetype(
@@ -1026,7 +1026,7 @@ def test_sbix(layout_engine: ImageFont.Layout) -> None:
10261026
im = Image.new("RGB", (400, 400), "white")
10271027
d = ImageDraw.Draw(im)
10281028

1029-
d.text((50, 50), "\uE901", font=font, embedded_color=True)
1029+
d.text((50, 50), "\ue901", font=font, embedded_color=True)
10301030

10311031
assert_image_similar_tofile(im, "Tests/images/chromacheck-sbix.png", 1)
10321032
except OSError as e: # pragma: no cover
@@ -1043,7 +1043,7 @@ def test_sbix_mask(layout_engine: ImageFont.Layout) -> None:
10431043
im = Image.new("RGB", (400, 400), "white")
10441044
d = ImageDraw.Draw(im)
10451045

1046-
d.text((50, 50), "\uE901", (100, 0, 0), font=font)
1046+
d.text((50, 50), "\ue901", (100, 0, 0), font=font)
10471047

10481048
assert_image_similar_tofile(im, "Tests/images/chromacheck-sbix_mask.png", 1)
10491049
except OSError as e: # pragma: no cover

Tests/test_imagefontctl.py

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ def test_getlength(
229229
@pytest.mark.parametrize("direction", ("ltr", "ttb"))
230230
@pytest.mark.parametrize(
231231
"text",
232-
("i" + ("\u030C" * 15) + "i", "i" + "\u032C" * 15 + "i", "\u035Cii", "i\u0305i"),
232+
("i" + ("\u030c" * 15) + "i", "i" + "\u032c" * 15 + "i", "\u035cii", "i\u0305i"),
233233
ids=("caron-above", "caron-below", "double-breve", "overline"),
234234
)
235235
def test_getlength_combine(mode: str, direction: str, text: str) -> None:
@@ -272,27 +272,27 @@ def test_anchor_ttb(anchor: str) -> None:
272272

273273
combine_tests = (
274274
# extends above (e.g. issue #4553)
275-
("caron", "a\u030C\u030C\u030C\u030C\u030Cb", None, None, 0.08),
276-
("caron_la", "a\u030C\u030C\u030C\u030C\u030Cb", "la", None, 0.08),
277-
("caron_lt", "a\u030C\u030C\u030C\u030C\u030Cb", "lt", None, 0.08),
278-
("caron_ls", "a\u030C\u030C\u030C\u030C\u030Cb", "ls", None, 0.08),
279-
("caron_ttb", "ca" + ("\u030C" * 15) + "b", None, "ttb", 0.3),
280-
("caron_ttb_lt", "ca" + ("\u030C" * 15) + "b", "lt", "ttb", 0.3),
275+
("caron", "a\u030c\u030c\u030c\u030c\u030cb", None, None, 0.08),
276+
("caron_la", "a\u030c\u030c\u030c\u030c\u030cb", "la", None, 0.08),
277+
("caron_lt", "a\u030c\u030c\u030c\u030c\u030cb", "lt", None, 0.08),
278+
("caron_ls", "a\u030c\u030c\u030c\u030c\u030cb", "ls", None, 0.08),
279+
("caron_ttb", "ca" + ("\u030c" * 15) + "b", None, "ttb", 0.3),
280+
("caron_ttb_lt", "ca" + ("\u030c" * 15) + "b", "lt", "ttb", 0.3),
281281
# extends below
282-
("caron_below", "a\u032C\u032C\u032C\u032C\u032Cb", None, None, 0.02),
283-
("caron_below_ld", "a\u032C\u032C\u032C\u032C\u032Cb", "ld", None, 0.02),
284-
("caron_below_lb", "a\u032C\u032C\u032C\u032C\u032Cb", "lb", None, 0.02),
285-
("caron_below_ls", "a\u032C\u032C\u032C\u032C\u032Cb", "ls", None, 0.02),
286-
("caron_below_ttb", "a" + ("\u032C" * 15) + "b", None, "ttb", 0.03),
287-
("caron_below_ttb_lb", "a" + ("\u032C" * 15) + "b", "lb", "ttb", 0.03),
282+
("caron_below", "a\u032c\u032c\u032c\u032c\u032cb", None, None, 0.02),
283+
("caron_below_ld", "a\u032c\u032c\u032c\u032c\u032cb", "ld", None, 0.02),
284+
("caron_below_lb", "a\u032c\u032c\u032c\u032c\u032cb", "lb", None, 0.02),
285+
("caron_below_ls", "a\u032c\u032c\u032c\u032c\u032cb", "ls", None, 0.02),
286+
("caron_below_ttb", "a" + ("\u032c" * 15) + "b", None, "ttb", 0.03),
287+
("caron_below_ttb_lb", "a" + ("\u032c" * 15) + "b", "lb", "ttb", 0.03),
288288
# extends to the right (e.g. issue #3745)
289-
("double_breve_below", "a\u035Ci", None, None, 0.02),
290-
("double_breve_below_ma", "a\u035Ci", "ma", None, 0.02),
291-
("double_breve_below_ra", "a\u035Ci", "ra", None, 0.02),
292-
("double_breve_below_ttb", "a\u035Cb", None, "ttb", 0.02),
293-
("double_breve_below_ttb_rt", "a\u035Cb", "rt", "ttb", 0.02),
294-
("double_breve_below_ttb_mt", "a\u035Cb", "mt", "ttb", 0.02),
295-
("double_breve_below_ttb_st", "a\u035Cb", "st", "ttb", 0.02),
289+
("double_breve_below", "a\u035ci", None, None, 0.02),
290+
("double_breve_below_ma", "a\u035ci", "ma", None, 0.02),
291+
("double_breve_below_ra", "a\u035ci", "ra", None, 0.02),
292+
("double_breve_below_ttb", "a\u035cb", None, "ttb", 0.02),
293+
("double_breve_below_ttb_rt", "a\u035cb", "rt", "ttb", 0.02),
294+
("double_breve_below_ttb_mt", "a\u035cb", "mt", "ttb", 0.02),
295+
("double_breve_below_ttb_st", "a\u035cb", "st", "ttb", 0.02),
296296
# extends to the left (fail=0.064)
297297
("overline", "i\u0305", None, None, 0.02),
298298
("overline_la", "i\u0305", "la", None, 0.02),
@@ -346,7 +346,7 @@ def test_combine_multiline(anchor: str, align: str) -> None:
346346

347347
path = f"Tests/images/test_combine_multiline_{anchor}_{align}.png"
348348
f = ImageFont.truetype("Tests/fonts/NotoSans-Regular.ttf", 48)
349-
text = "i\u0305\u035C\ntext" # i with overline and double breve, and a word
349+
text = "i\u0305\u035c\ntext" # i with overline and double breve, and a word
350350

351351
im = Image.new("RGB", (400, 400), "white")
352352
d = ImageDraw.Draw(im)

0 commit comments

Comments
 (0)