This repository has been archived by the owner on May 12, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 112
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Using just virtualenv now if -e flag is used - Virtualenv will be created in ~/ocw location
- Loading branch information
Showing
1 changed file
with
9 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -62,7 +62,7 @@ echo | |
WITH_VIRTUAL_ENV=0 | ||
WITH_HOMEBREW=0 | ||
WITH_INTERACT=1 | ||
|
||
INIT_PWD=$PWD | ||
while getopts ":h :e :q" FLAG | ||
do | ||
case $FLAG in | ||
|
@@ -131,33 +131,12 @@ if [ $WITH_VIRTUAL_ENV == 1 ]; then | |
subtask "done" | ||
fi | ||
|
||
# Check if virtualenvwrapper is installed or not. If it's not, we'll | ||
# install it for the user. Why wouldn't you want to use virtualenvwrapper?!?! | ||
# It's super awesome! By default, virtualenvwrapper installs to the same place | ||
# as virtualenv so we'll look for the necessary scripts there. This is fairly | ||
# brittle, but it should be sufficient for the majority of cases. | ||
virtualEnvLoc=`which virtualenv` | ||
virtualEnvWrapperLoc="${virtualEnvLoc}wrapper.sh" | ||
|
||
if [ ! -f $virtualEnvWrapperLoc ]; then | ||
task "Installing virtualenvwrapper ..." | ||
pip install virtualenvwrapper >> install_log | ||
subtask "done" | ||
|
||
task "Setting/sourcing necessary virtualenv things ..." | ||
# Need to setup environment for virtualenv | ||
export WORKON_HOME=$HOME/.virtualenvs | ||
subtask "done" | ||
fi | ||
|
||
# Just to be safe, we'll source virtualenvwrapper. This is really only | ||
# necessary if we installed it for the user. | ||
source $virtualEnvWrapperLoc | ||
|
||
# Create a new environment for OCW work | ||
task "Creating a new environment ..." | ||
mkvirtualenv ocw >> install_log | ||
workon ocw >> install_log | ||
task "Creating a new environment in ~/ocw..." | ||
cd ~ | ||
virtualenv ocw >> install_log | ||
source ~/ocw/bin/activate >> install_log | ||
cd $INIT_PWD | ||
subtask "done" | ||
fi | ||
|
||
|
@@ -170,6 +149,9 @@ conda init >> install_log | |
header "Installing dependencies with conda ..." | ||
echo | conda install --file ocw-conda-dependencies.txt | ||
|
||
# Before installing packages with pip we need to activate the virtualenv with conda | ||
source ~/ocw/bin/activate ~/ocw >> install_log | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
cgoodale
Author
Contributor
|
||
|
||
# We only use conda for the annoying dependencies like numpy, | ||
# scipy, matplotlib, and basemap. For everything else, we stick | ||
# with pip. | ||
|
What if the user doesn't ask for a virtualenv to be installed? Certainly this would fail out at this point? Do we need to have it sourced twice due to some issue with virtualenv/conda?