File tree 2 files changed +26
-0
lines changed
2 files changed +26
-0
lines changed Original file line number Diff line number Diff line change 236
236
237
237
# Tests
238
238
if [ " $1 " = " test" ]; then
239
+ shift
239
240
if [ -n " $WHEELDIR " ]; then
240
241
$PREFIX /bin/pip install $WHEELDIR /pygit2* -$PYTHON_TAG -* .whl
241
242
fi
242
243
$PREFIX /bin/pip install -r requirements-test.txt
243
244
$PREFIX /bin/pytest --cov=pygit2
244
245
fi
246
+
247
+ # Test .pyi stub file
248
+ if [ " $1 " = " stubtest" ]; then
249
+ shift
250
+ $PREFIX /bin/pip install mypy
251
+ PYTHONPATH=. $PREFIX /bin/stubtest --mypy-config-file mypy-stubtest.ini pygit2._pygit2
252
+ [ $? == 0 ] && echo " stubtest OK"
253
+ fi
254
+
Original file line number Diff line number Diff line change
1
+ # Config file for testing the stub file (_pygit2.pyi) with "stubtest"
2
+ # (tool shipped with mypy).
3
+ #
4
+ # Run "build.sh stubtest", or:
5
+ # stubtest --mypy-config-file test/mypy-stubtest.ini pygit2._pygit2
6
+ #
7
+ # Format info:
8
+ # https://mypy.readthedocs.io/en/stable/config_file.html
9
+
10
+ [mypy]
11
+ warn_unused_configs = True
12
+ disallow_any_explicit = True
13
+
14
+ # don't follow import pygit2 from _pygit2.pyi, we only want to check the pyi file.
15
+ [mypy-pygit2]
16
+ follow_imports = skip
You can’t perform that action at this time.
0 commit comments