Browse Source

dev_env(feat): Notify engineers how to get pyenv configured correctly (#24402)

Many engineers use `pyenv install 3.6.13` when trying to get the right Python version installed in their machines, however, this does not work in Big Sur with Python 3.6.

This change informs engineers to use `make setup-pyenv` which makes some changes to pyenv's build in order to build it correctly in Big Sur.
Armen Zambrano G 4 years ago
parent
commit
07c9286e33
1 changed files with 5 additions and 0 deletions
  1. 5 0
      .envrc

+ 5 - 0
.envrc

@@ -131,6 +131,7 @@ for pkg in \
     docker \
     chromedriver \
     pkg-config \
+    pyenv \
     openssl; do
     if ! require "$pkg"; then
         die "You seem to be missing the system dependency: ${pkg}
@@ -152,6 +153,10 @@ info "Activating virtualenv..."
 
 if [ ! -f "${venv_name}/bin/activate" ]; then
     info "You don't seem to have a virtualenv."
+    # If the version doesn't match the contents of .python-version it will fail
+    [[ $(pyenv version) ]] || \
+        die "Please run:
+    make setup-pyenv && python3.6 -m venv ${venv_name}"
     advice_init_venv "$venv_name"
 fi