diff --git a/contrib/setup-pytype.sh b/contrib/setup-pytype.sh new file mode 100755 --- /dev/null +++ b/contrib/setup-pytype.sh @@ -0,0 +1,33 @@ +#!/bin/bash + +set -e +set -u + +# Find the python3 setup that would run pytype +PYTYPE=`which pytype` +PYTHON3=`head -n1 ${PYTYPE} | sed -s 's/#!//'` + +# Existing stubs that pytype processes live here +TYPESHED=$(${PYTHON3} -c "import pytype; print(pytype.__path__[0])")/typeshed/stubs +HG_STUBS=${TYPESHED}/mercurial + +echo "Patching typeshed at $HG_STUBS" + +rm -rf ${HG_STUBS} +mkdir -p ${HG_STUBS} + +cat > ${HG_STUBS}/METADATA.toml <