mirror of
ssh://git.janware.com/srv/git/janware/proj/jw-pkg
synced 2026-01-15 03:53:32 +01:00
make, scripts: Add support for static Python typechecking
This commit adds support for static typechecking with mypy.
Notable additions:
- A new target "check" which does the type checking
- Py-mods.mk, meant to be included from a directory containing python modules
in subdirectories, but not being a python module itself. It makes the all
target depend on check only if PY_RUN_CHECK_AFTER_BUILD is defined and
true. That's because pypy is under heavy development, and the Ubuntu 18.04
version is too old to work for lots of the code.
Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
parent
089aebeaec
commit
a404be15b9
4 changed files with 25 additions and 3 deletions
|
|
@ -26,7 +26,8 @@ cmd_create_init()
|
|||
local del="-------------------------- generated by $myname"
|
||||
echo "# >> $del >>"
|
||||
echo "from pkgutil import extend_path"
|
||||
echo "__path__ = extend_path(__path__, __name__)"
|
||||
echo "from typing import Iterable"
|
||||
echo "__path__ = extend_path(__path__, __name__) # type: Iterable[str]"
|
||||
files="$*"
|
||||
for f in $files; do
|
||||
test -d $f && continue
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue