Skip to content

Commit ab742de

Browse files
committed
⬆️ github CI and mypy updates
1 parent faf9771 commit ab742de

File tree

7 files changed

+10
-12
lines changed

7 files changed

+10
-12
lines changed

.github/workflows/docs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
- uses: actions/checkout@v3
2222

2323
- name: Set up Python ${{ matrix.python-version }}
24-
uses: actions/setup-python@v2
24+
uses: actions/setup-python@v4
2525
with:
2626
python-version: ${{ matrix.python-version }}
2727

.github/workflows/license.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
- uses: actions/checkout@v3
1919

2020
- name: Set up Python ${{ matrix.python-version }}
21-
uses: actions/setup-python@v2
21+
uses: actions/setup-python@v4
2222
with:
2323
python-version: ${{ matrix.python-version }}
2424

.github/workflows/linting.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
- uses: actions/checkout@v3
1818

1919
- name: Set up Python ${{ matrix.python-version }}
20-
uses: actions/setup-python@v2
20+
uses: actions/setup-python@v4
2121
with:
2222
python-version: ${{ matrix.python-version }}
2323

@@ -36,7 +36,7 @@ jobs:
3636
pip install -e .[dev]
3737
3838
- name: Cache pre-commit
39-
uses: actions/cache@v2
39+
uses: actions/cache@v3
4040
with:
4141
path: ~/.cache/pre-commit
4242
key: ${{ runner.os }}-prec-${{ hashFiles('.pre-commit-config.yaml') }}

.github/workflows/publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
- uses: actions/checkout@v3
1919

2020
- name: Set up Python ${{ matrix.python-version }}
21-
uses: actions/setup-python@v2
21+
uses: actions/setup-python@v4
2222
with:
2323
python-version: ${{ matrix.python-version }}
2424

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ repos:
3434
]
3535

3636
- repo: https://github.com/pre-commit/mirrors-mypy
37-
rev: v1.0.1
37+
rev: v1.4.1
3838
hooks:
3939
- id: mypy
4040
args: []

mindee/input/sources.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -142,15 +142,13 @@ def is_pdf_empty(self) -> bool:
142142
self.file_object.seek(0)
143143
with pikepdf.open(self.file_object) as pdf:
144144
for page in pdf.pages:
145-
# mypy incorrectly identifies the "/Length" key's value as
146-
# an object rather than an int.
147145
try:
148146
total_size = page["/Contents"]["/Length"]
149147
except ValueError:
150-
total_size = 0 # type: ignore
151-
for content in page["/Contents"]: # type: ignore
148+
total_size = 0
149+
for content in page["/Contents"]:
152150
total_size += content["/Length"]
153-
has_data = total_size > 1000 # type: ignore
151+
has_data = total_size > 1000
154152

155153
has_font = "/Font" in page["/Resources"].keys()
156154
has_xobj = "/XObject" in page["/Resources"].keys()

setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ mindee =
4646
[options.extras_require]
4747
dev =
4848
black==23.1.0
49-
mypy==1.0.1
49+
mypy==1.4.1
5050
pip-tools~=6.12.3
5151
pylint==2.17.1
5252
setuptools==51.3.3

0 commit comments

Comments
 (0)