Run mypy through a pyenv/virtualenv enabler wrapper script (#30922)
This commit is contained in:
1 parent
79495d9f3a
commit
dc5ca461a9
7 files changed
+38
-73
No files matched your search
@@ -253,7 +253,7 @@ def requirements_test_output(reqs):
|
||||
|
||||
def requirements_pre_commit_output():
|
||||
"""Generate output for pre-commit dependencies."""
|
||||
source = ".pre-commit-config-all.yaml"
|
||||
source = ".pre-commit-config.yaml"
|
||||
pre_commit_conf = load_yaml(source)
|
||||
reqs = []
|
||||
for repo in (x for x in pre_commit_conf["repos"] if x.get("rev")):
|
||||
|
||||
Executable
+18
@@ -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 "$@"
|
||||
Reference in new issue
Block a user