Skip to content

Commit 19010df

Browse files
authored
Merge pull request #354 from JamesParrott/Req-mypy-strict-in-CI
Req mypy strict in ci
2 parents df3ac3d + 54eef40 commit 19010df

File tree

4 files changed

+171
-92
lines changed

4 files changed

+171
-92
lines changed

.github/workflows/run_checks_build_and_test.yml

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,28 @@ jobs:
1313
runs-on: ubuntu-latest
1414
steps:
1515
- uses: actions/checkout@v4
16-
- uses: actions/setup-python@v5
1716
- uses: pre-commit/[email protected]
1817

18+
mypy-strict:
19+
runs-on: ubuntu-latest
20+
steps:
21+
- uses: actions/checkout@v4
22+
- uses: actions/setup-python@v5
23+
with:
24+
python-version: "3.13"
25+
- name: Install mypy
26+
run: pip install mypy
27+
- name: Run mypy --strict
28+
run: mypy --strict ./src/shapefile.py
29+
30+
1931
build_wheel_and_sdist:
2032
runs-on: ubuntu-latest
2133
steps:
2234
- uses: actions/checkout@v4
2335
- uses: actions/setup-python@v5
36+
with:
37+
python-version: "3.13"
2438
- name: Build wheel from the project repo
2539
uses: ./.github/actions/build_wheel_and_sdist
2640

changelog.txt

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
VERSION WIP
2+
Improvements:
3+
* LICENSE.TXT re-encoded in UTF-8 (@musicinmybrain)
4+
15
VERSION 3.0.0
26

37
2025-08-03
@@ -15,13 +19,13 @@ VERSION 3.0.0
1519

1620
Code quality
1721
* Statically typed and checked with Mypy
18-
* Checked with Ruff.
22+
* Checked with Ruff. (@mwtoews)
1923
* Type hints
2024
* f-strings
2125
* Remove Python 2 specific functions.
2226
* Run doctests against wheels.
2327
* Testing of wheels before publishing them
24-
* pyproject.toml src layout
28+
* Updated metadata, changed build backend to Hatch, and restructured repor into pyproject.toml src layout (@mwtoews)
2529
* Slow test marked.
2630

2731
Improvements:

run_benchmarks.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
from collections.abc import Callable
1010
from pathlib import Path
1111
from tempfile import TemporaryFile as TempF
12-
from typing import Union
12+
from typing import Iterable, Union, cast
1313

1414
import shapefile
1515

@@ -63,8 +63,9 @@ def write_shapefile_with_PyShp(target: Union[str, os.PathLike]):
6363
for field_info_tuple in fields[target]:
6464
w.field(*field_info_tuple)
6565
for shapeRecord in shapeRecords[target]:
66-
w.shape(shapeRecord.shape)
67-
w.record(*shapeRecord.record)
66+
w.shape(cast(shapefile.Shape, shapeRecord.shape))
67+
record = cast(Iterable, shapeRecord.record)
68+
w.record(*record)
6869

6970

7071
SHAPEFILES = {

0 commit comments

Comments
 (0)