#!/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 <