From 79cb486cb64cb45cd0d62ae9b9f8d8a697aee41b Mon Sep 17 00:00:00 2001 From: JohnE Date: Wed, 10 Oct 2018 11:45:45 -0700 Subject: [PATCH] MOD: updated python 3 aliases in support of new pip module --- .bash_python | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/.bash_python b/.bash_python index 84278ee..090fee4 100644 --- a/.bash_python +++ b/.bash_python @@ -1,18 +1,30 @@ # pip should only run if there is a virtualenv currently activated export PIP_REQUIRE_VIRTUALENV=true -# Python virtualenv +# Python 2 (python 2 is losing support fast) +# alias venv='virtualenv' + +# Python 3 +# +alias pip3='python3 -m pip' +alias venv3='python3 -m venv' +venv3.a () { + source $1/bin/activate; +} + +# using a global virtural environment location, but I usually put it in the project path +# to reduce my own confusion =) SRC_DIRECTORY="/Volumes/malloc-dev/virtenvs" -alias venv='virtualenv' -alias venv3='virtualenv -p python3' -alias venv.cd="cd $SRC_DIRECTORY" -venv.a () { +alias venv3.cd="cd $SRC_DIRECTORY" +venv3.aa () { source $SRC_DIRECTORY/$1/bin/activate; } -venv.ls () { +venv3.ls () { ll $SRC_DIRECTORY } + + # python interpreter w/auto complete # pip install bpython bbpython () {