Run mypy through a pyenv/virtualenv enabler wrapper script (#30922)

This commit is contained in:
Ville Skyttä
2020-02-01 17:12:46 +02:00
committed by GitHub
parent 79495d9f3a
commit dc5ca461a9
7 changed files with 38 additions and 73 deletions

18
script/run-in-env.sh Executable file
View File

@ -0,0 +1,18 @@
#!/bin/sh -eu
# Activate pyenv and virtualenv if present, then run the specified command
# pyenv, pyenv-virtualenv
if [ -s .python-version ]; then
PYENV_VERSION=$(head -n 1 .python-version)
export PYENV_VERSION
fi
# other common virtualenvs
for venv in venv .venv .; do
if [ -f $venv/bin/activate ]; then
. $venv/bin/activate
fi
done
exec "$@"