Skip to content

Commit a2c11dc

Browse files
authored
test with new pdfminer & python versions (#115)
* stop testing python 3.8, as the latest pdfminer doesn't support it * use new unittest methods in python 3.14 * explicitly list & pin testing requirements outside of GH workflow
1 parent 460fcf7 commit a2c11dc

File tree

5 files changed

+17
-15
lines changed

5 files changed

+17
-15
lines changed

.github/workflows/python-checks.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
runs-on: ubuntu-latest
1616
strategy:
1717
matrix:
18-
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]
18+
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13", "3.14"]
1919

2020
steps:
2121
- uses: actions/checkout@v2
@@ -26,8 +26,7 @@ jobs:
2626
- name: Install dependencies
2727
run: |
2828
python -m pip install --upgrade pip
29-
python -m pip install flake8 mypy autopep8 pytest
30-
pip install -r requirements.txt
29+
pip install -r requirements-dev.txt
3130
- name: Type check with mypy
3231
run: mypy .
3332
- name: Lint with flake8

pyproject.toml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,6 @@ classifiers = [
1818
"Topic :: Text Processing",
1919
"License :: OSI Approved :: MIT License",
2020
"Programming Language :: Python :: 3",
21-
"Programming Language :: Python :: 3.8",
22-
"Programming Language :: Python :: 3.9",
23-
"Programming Language :: Python :: 3.10",
24-
"Programming Language :: Python :: 3.11",
25-
"Programming Language :: Python :: 3.12",
26-
"Programming Language :: Python :: 3.13",
2721
]
2822

2923
[project.scripts]

requirements-dev.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# dev/test requirements for pdfannots (not required for everyday use)
2+
-r requirements.txt
3+
autopep8 == 2.3.2
4+
flake8 == 7.3.0
5+
mypy == 1.18.2
6+
pytest >= 8.4

requirements.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# pip requirements for pdfannots
1+
# general requirements for pdfannots
22
# Use as: pip3 install -r requirements.txt
33

4-
pdfminer.six == 20231228
4+
pdfminer.six == 20251107

tests.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import operator
66
import pathlib
77
import re
8+
import sys
89
import typing as typ
910
import unittest
1011
from datetime import datetime, timedelta, timezone
@@ -48,11 +49,13 @@ def setUp(self) -> None:
4849
self.annots = [a for p in self.doc.pages for a in p.annots]
4950
self.outlines = [o for p in self.doc.pages for o in p.outlines]
5051

51-
def assertEndsWith(self, bigstr: str, suffix: str) -> None:
52-
self.assertEqual(bigstr[-len(suffix):], suffix)
52+
if sys.version_info < (3, 14):
53+
def assertEndsWith(self, bigstr: str, suffix: str) -> None:
54+
self.assertEqual(bigstr[-len(suffix):], suffix)
5355

54-
def assertStartsWith(self, bigstr: str, prefix: str) -> None:
55-
self.assertEqual(bigstr[:len(prefix)], prefix)
56+
if sys.version_info < (3, 14):
57+
def assertStartsWith(self, bigstr: str, prefix: str) -> None:
58+
self.assertEqual(bigstr[:len(prefix)], prefix)
5659

5760

5861
class ExtractionTests(ExtractionTestBase):

0 commit comments

Comments
 (0)