.local/bin: added new fuctions for creating python_env
Signed-off-by: Marcin Woźniak <y0rune@aol.com>
This commit is contained in:
20
.local/bin/python_env
Executable file
20
.local/bin/python_env
Executable file
@@ -0,0 +1,20 @@
|
||||
#!/bin/bash
|
||||
|
||||
source "$HOME"/.local/bin/functions
|
||||
|
||||
# Function for creating a python env
|
||||
python_env(){
|
||||
|
||||
[ -z "$PYTHONVERSION" ] && err "Python version is not set"
|
||||
|
||||
command_exists virtualenv
|
||||
|
||||
timestamp "Creating Python environment with version $PYTHONVERSION"
|
||||
rm -rf .venv .env && timestamp "Old Python environment has been removed"
|
||||
virtualenv -p "$PYTHONVERSION" .venv
|
||||
|
||||
.venv/bin/python -m pip install --upgrade pip
|
||||
.venv/bin/pip install -r requirements.txt --break --force
|
||||
}
|
||||
|
||||
python_env "$@"
|
||||
Reference in New Issue
Block a user