Skip to content

Commit 1978e14

Browse files
committed
add mypy ci step
1 parent 7fbdc1d commit 1978e14

File tree

3 files changed

+14
-0
lines changed

3 files changed

+14
-0
lines changed

.github/workflows/lint.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,6 @@ jobs:
2424

2525
- name: Check code style with ruff
2626
run: ruff format --diff
27+
28+
- name: Check typing with mypy
29+
run: LIBSSH2_VERSION=1.11.1 LIBGIT2_VERSION=1.9.1 /bin/sh build.sh mypy

build.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,16 @@ if [ "$1" = "test" ]; then
262262
$PREFIX/bin/pytest --cov=pygit2
263263
fi
264264

265+
# Type checking
266+
if [ "$1" = "mypy" ]; then
267+
shift
268+
if [ -n "$WHEELDIR" ]; then
269+
$PREFIX/bin/pip install $WHEELDIR/pygit2*-$PYTHON_TAG-*.whl
270+
fi
271+
$PREFIX/bin/pip install -r requirements-test.txt
272+
$PREFIX/bin/mypy pygit2
273+
fi
274+
265275
# Test .pyi stub file
266276
if [ "$1" = "stubtest" ]; then
267277
shift

requirements-test.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
pytest
22
pytest-cov
3+
mypy

0 commit comments

Comments
 (0)