I am using pyenv to manage different Python versions on my machine, and pyenv-virtualenv to manage my venvs. When I create a new venv with something like pyenv virtualenv foo it doesn't install the latest version of pip, setuptools, and wheel into the venv. I would like to run pip install --upgrade pip setuptools wheel inside each venv after it has been created.
pyenv has the concept of hooks for before and after a command. I am able to run this command by adding the following file
~/.pyenv/plugins/pyenv-virtualenv/etc/pyenv.d/virtualenv/after.bash
with the following contents
after_virtualenv 'pip install --upgrade pip setuptools wheel'
The command is run, but it is not run inside the venv, so it just uses the current pip. How can I call this command inside the venv in the after_virtualenv hook?