Skip to content

Commit d6a2593

Browse files
Merge branch 'next' into python314
2 parents d31a384 + d1bebda commit d6a2593

File tree

4 files changed

+10
-15
lines changed

4 files changed

+10
-15
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Development Version
22

33
* Allow setting the maximum image pixel size for *Pillow* in `hocr_pdf`.
4+
* Drop support for Python <= 3.9.
45

56
# Version 1.2.0 - 2025-07-01
67

pyproject.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ keywords = [
2828
"hocr",
2929
"xhtml",
3030
]
31-
requires-python = ">=3.9, <4"
31+
requires-python = ">=3.10, <4"
3232
dependencies = [
3333
"Pillow>=9.3.0",
3434
"lxml>=3.5.0",
@@ -49,7 +49,6 @@ dev = [
4949
"beautifulsoup4",
5050
"requests",
5151
"pypdf",
52-
"importlib-resources; python_version < '3.10'",
5352
# Linting.
5453
"flake8",
5554
"flake8-bugbear",

requirements.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# Ensure that we always test against the latest versions
22
# as soon as they get released by pinning them here and
33
# letting `dependabot` update them for new releases.
4-
Pillow==11.3.0
4+
Pillow==12.0.0
55
lxml==6.0.2
66
python-bidi==0.6.6
77
reportlab==4.4.4
8-
pypdf==6.1.1
8+
pypdf==6.1.2

tests/__init__.py

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,34 +4,29 @@
44
import shutil
55
import sys
66
from contextlib import ExitStack
7+
from importlib import resources
78
from pathlib import Path
8-
from typing import cast
99
from unittest import TestCase as _TestCase
1010

11-
if sys.version_info < (3, 10):
12-
import importlib_resources
13-
else:
14-
import importlib.resources as importlib_resources
15-
1611

1712
class TestCase(_TestCase):
1813
@classmethod
1914
def get_data_file(cls, path: str) -> str:
2015
file_manager = ExitStack()
2116
atexit.register(file_manager.close)
22-
reference = importlib_resources.files("tests.data") / path
17+
reference = resources.files("tests.data") / path
2318
return str(file_manager.enter_context(
24-
importlib_resources.as_file(reference)
19+
resources.as_file(reference)
2520
))
2621

2722
@classmethod
2823
def get_data_content(cls, path: str) -> bytes:
29-
reference = importlib_resources.files("tests.data") / path
30-
return cast(bytes, reference.read_bytes()) # type: ignore[redundant-cast,unused-ignore] # `cast` only required for Python < 3.10.
24+
reference = resources.files("tests.data") / path
25+
return reference.read_bytes()
3126

3227
@classmethod
3328
def get_data_directory(cls) -> Path:
34-
first_file = next(importlib_resources.files("tests.data").iterdir())
29+
first_file = next(resources.files("tests.data").iterdir())
3530
return Path(cls.get_data_file(first_file.name)).parent
3631

3732
@classmethod

0 commit comments

Comments
 (0)