Show More
@@ -0,0 +1,33 b'' | |||
|
1 | #!/bin/bash | |
|
2 | ||
|
3 | set -e | |
|
4 | set -u | |
|
5 | ||
|
6 | # Find the python3 setup that would run pytype | |
|
7 | PYTYPE=`which pytype` | |
|
8 | PYTHON3=`head -n1 ${PYTYPE} | sed -s 's/#!//'` | |
|
9 | ||
|
10 | # Existing stubs that pytype processes live here | |
|
11 | TYPESHED=$(${PYTHON3} -c "import pytype; print(pytype.__path__[0])")/typeshed/stubs | |
|
12 | HG_STUBS=${TYPESHED}/mercurial | |
|
13 | ||
|
14 | echo "Patching typeshed at $HG_STUBS" | |
|
15 | ||
|
16 | rm -rf ${HG_STUBS} | |
|
17 | mkdir -p ${HG_STUBS} | |
|
18 | ||
|
19 | cat > ${HG_STUBS}/METADATA.toml <<EOF | |
|
20 | version = "0.1" | |
|
21 | EOF | |
|
22 | ||
|
23 | ||
|
24 | mkdir -p ${HG_STUBS}/mercurial/cext ${HG_STUBS}/mercurial/thirdparty/attr | |
|
25 | ||
|
26 | touch ${HG_STUBS}/mercurial/__init__.pyi | |
|
27 | touch ${HG_STUBS}/mercurial/cext/__init__.pyi | |
|
28 | touch ${HG_STUBS}/mercurial/thirdparty/__init__.pyi | |
|
29 | ||
|
30 | ln -sf $(hg root)/mercurial/cext/*.{pyi,typed} \ | |
|
31 | ${HG_STUBS}/mercurial/cext | |
|
32 | ln -sf $(hg root)/mercurial/thirdparty/attr/*.{pyi,typed} \ | |
|
33 | ${HG_STUBS}/mercurial/thirdparty/attr |
General Comments 0
You need to be logged in to leave comments.
Login now