-
Notifications
You must be signed in to change notification settings - Fork 0
/
creating_env_packaging_tutorial.sh
51 lines (41 loc) · 1.21 KB
/
creating_env_packaging_tutorial.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#!/bin/bash
# Project: packaging_tutorial
#
# Github repository: https://github.com/juancarlosmiranda/packaging_tutorial
# Author: Juan Carlos Miranda
# https://juancarlosmiranda.github.io/
# https://github.com/juancarlosmiranda
#
set -e
REQUERIMENTS_LINUX='requirements_linux.txt'
# commands definitions
PYTHON_CMD='python3'
UNZIP_CMD=`which unzip`
MKDIR_CMD='mkdir -p'
CHMOD_CMD='chmod 755'
PIP_INSTALL_CMD='pip install'
PIP_UPDATE_CMD='pip install --upgrade pip'
# files extensions names
EXT_SCRIPTS_SH='*.sh'
EXT_ZIP='.zip'
# folders names definitions
COMMON_VENV_PATH='bin/activate'
# software folders names
PROJECT_NAME='packaging_tutorial'
VENV_NAME='venv'
SEPARATOR='_'
DEVELOPMENT_PATH='development'
DEVELOPMENT_ENV_PATH='development_env'
# project folders
ROOT_FOLDER_F=$HOME/$DEVELOPMENT_PATH/
PROJECT_NAME_F=$ROOT_FOLDER_F$PROJECT_NAME/
PROJECT_NAME_VENV=$PROJECT_NAME_F$SEPARATOR$VENV_EXTENSION
# environment folders
ROOT_ENV_F=$HOME/$DEVELOPMENT_ENV_PATH/
PROJECT_NAME_VENV_F=$ROOT_ENV_F$PROJECT_NAME_VENV/
# creating environments automatically
$PYTHON_CMD -m venv $PROJECT_NAME_VENV_F
source $PROJECT_NAME_VENV_F/$COMMON_VENV_PATH
$PIP_UPDATE_CMD
$PIP_INSTALL_CMD -r $PROJECT_NAME_F$REQUERIMENTS_LINUX
deactivate