initial commit
This commit is contained in:
24
mypy
Executable file
24
mypy
Executable file
@ -0,0 +1,24 @@
|
||||
#!/bin/sh
|
||||
|
||||
### check type annotations with mypy
|
||||
|
||||
set -e
|
||||
|
||||
base=$(dirname "$(readlink -f "$0")")
|
||||
cd "${base}"
|
||||
|
||||
if [ ! -d "venv" -o ! -x "venv/bin/python" ]; then
|
||||
echo >&2 "Missing virtualenv in 'venv'; maybe run setup-venv.sh first!"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ ! -x ./venv/bin/mypy ]; then
|
||||
./venv/bin/pip install mypy
|
||||
fi
|
||||
|
||||
site_pkgs=$(./venv/bin/python -c 'import site; print(site.getsitepackages()[0])')
|
||||
if [ ! -d "${site_pkgs}/trio_typing" ]; then
|
||||
./venv/bin/pip install trio-typing[mypy]
|
||||
fi
|
||||
|
||||
./venv/bin/mypy --install-types src
|
Reference in New Issue
Block a user