-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.bash_python
More file actions
50 lines (37 loc) · 1.38 KB
/
.bash_python
File metadata and controls
50 lines (37 loc) · 1.38 KB
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
# Python-specific functionality for bash
# Virtualenvwrapper-related
# These values will get in the way if pip is needed to install system-wide packages
# Set to 'false' or empty '' may be required somet times.
#
# source: http://docs.python-guide.org/en/latest/dev/pip-virtualenv/
export PIP_REQUIRE_VIRTUALENV=true
export PIP_RESPECT_VIRTUALENV=true
export WORKON_HOME=$HOME/.venv
export VIRTUALENVWRAPPER_VIRTUALENV=$WORKON_HOME
# Oracle Linux - Python 3 detection
if [ -x /usr/bin/scl ]; then
RH_PYTHON="$(scl -l | grep rh-python3[1-9])"
if [ -n $RH_PYTHON ]; then
echo "* Enabling $RH_PYTHON"
source scl_source enable "${RH_PYTHON}"
PYTHON_3="/opt/rh/$RH_PYTHON/root/usr/bin/python"
if [ ! -x $PYTHON_3 ]; then
echo "? Python missing $PYTHON_3"
fi
fi
fi
# autoenv - Python 3 detection
# After installing autoenv (system-wide or per-user), create a symlink
# in the $WORKON_HOME directory [for now]
if [ -e $WORKON_HOME/activate.sh ]; then
export AUTOENV_HOME=$HOME/.autoenv
mkdir -p $AUTOENV_HOME
export AUTOENV_AUTH_FILE=$AUTOENV_HOME/.autoenv_authorized
export AUTOENV_FILENAME=.env
# Current version of the repo doesn't appear to honor/follow this rule
# as I had expected. Commenting out for now.
# export AUTOENV_ENV_LEAVE_FILENAME=.env.leave
# export AUTOENV_ENABLE_LEAVE='yes'
echo "* Enabling autoenv"
source $WORKON_HOME/activate.sh
fi