David-OConnor/pyflow

Small Feature suggestion: Add 'shell' command to activate the venv for the currently selected Python version

Haffi921 opened this issue · 0 comments

Just thought it might be a nice little feature to have a pyflow shell command which activates the current python version's venv. Users can obviously easily do this themselves. However, this is similar to how pyenv, Poetry and pipenv do it and I believe it's valid to include it as a feature rather than for users seeking this function to do it themselves.

Considering the simplified nature of having all python installments and their venv in the folder __pypackages__, the solution seems simple. Simply put, pyflow shell does:

# Mac
source __pypackages__/[current_python_version]/.venv/Scripts/activate

# Windows (powershell)
.\__pypackages__\[current_python_version]\.venv\Scripts\activate

Again, this is something many users might know how to do themselves, but a user always needs to:

  1. Find the .venv folder (First time use)
  2. Realize what version is current (If more than one version is installed)
  3. Write this whole thing out, because it cannot be easily generalized in an alias

Compared to pyflow shell the steps are: 1) Type pyflow shell 😄