comparison contrib/setup-pytype.sh @ 51711:832a1aeb576f

pytype: only try the hacky way of finding PYTHON if not provided This allows us to work in more environments, like when using pyenv. This syntax is compatible with all POSIX shells.
author Raphaël Gomès <rgomes@octobus.net>
date Tue, 23 Jul 2024 12:10:31 +0200
parents 7f0cb9ee0534
children
comparison
equal deleted inserted replaced
51710:8fe7c0e1df1e 51711:832a1aeb576f
3 set -e 3 set -e
4 set -u 4 set -u
5 5
6 # Find the python3 setup that would run pytype 6 # Find the python3 setup that would run pytype
7 PYTYPE=`which pytype` 7 PYTYPE=`which pytype`
8 PYTHON3=`head -n1 ${PYTYPE} | sed -s 's/#!//'` 8 PYTHON3=${PYTHON:-`head -n1 ${PYTYPE} | sed -s 's/#!//'`}
9 9
10 # Existing stubs that pytype processes live here 10 # Existing stubs that pytype processes live here
11 TYPESHED=$(${PYTHON3} -c "import pytype; print(pytype.__path__[0])")/typeshed/stubs 11 TYPESHED=$(${PYTHON3} -c "import pytype; print(pytype.__path__[0])")/typeshed/stubs
12 HG_STUBS=${TYPESHED}/mercurial 12 HG_STUBS=${TYPESHED}/mercurial
13 13