|
|
|
@ -7,6 +7,7 @@
|
|
|
|
|
BUCKET = {{ cookiecutter.s3_bucket }}
|
|
|
|
|
PROJECT_NAME = {{ cookiecutter.repo_name }}
|
|
|
|
|
PYTHON_INTERPRETER = {{ cookiecutter.python_interpreter }}
|
|
|
|
|
IS_ANACONDA=$(shell python -c "import sys;t=str('anaconda' in sys.version.lower() or 'continuum' in sys.version.lower());sys.stdout.write(t)")
|
|
|
|
|
|
|
|
|
|
#################################################################################
|
|
|
|
|
# COMMANDS #
|
|
|
|
@ -38,12 +39,21 @@ sync_data_from_s3:
|
|
|
|
|
|
|
|
|
|
## Set up python interpreter environment
|
|
|
|
|
create_environment: |
|
|
|
|
@pip install -q virtualenvwrapper
|
|
|
|
|
ifeq (True,$(IS_ANACONDA)) |
|
|
|
|
@echo ">>> Detected Anaconda, creating conda environment."
|
|
|
|
|
ifeq (3,$(findstr 3,$(PYTHON_INTERPRETER))) |
|
|
|
|
conda create --name $(PROJECT_NAME) python=3.5
|
|
|
|
|
else |
|
|
|
|
conda create --name $(PROJECT_NAME) python=2.7
|
|
|
|
|
endif |
|
|
|
|
@echo ">>> New conda env created. Activate with:\nsource activate $(PROJECT_NAME)"
|
|
|
|
|
else |
|
|
|
|
@pip install -q virtualenv virtualenvwrapper
|
|
|
|
|
@echo ">>> Installing virtualenvwrapper if not already intalled.\nMake sure the following lines are in shell startup file\n\
|
|
|
|
|
export WORKON_HOME=$HOME/.virtualenvs\nexport PROJECT_HOME=$HOME/Devel\nsource /usr/local/bin/virtualenvwrapper.sh\n"
|
|
|
|
|
|
|
|
|
|
source /usr/local/bin/virtualenvwrapper.sh; mkvirtualenv $(PROJECT_NAME) --python=$(PYTHON_INTERPRETER)
|
|
|
|
|
export WORKON_HOME=$$HOME/.virtualenvs\nexport PROJECT_HOME=$$HOME/Devel\nsource /usr/local/bin/virtualenvwrapper.sh\n"
|
|
|
|
|
@bash -c "source `which virtualenvwrapper.sh`;mkvirtualenv $(PROJECT_NAME) --python=$(PYTHON_INTERPRETER)"
|
|
|
|
|
@echo ">>> New virtualenv created. Activate with:\nworkon $(PROJECT_NAME)"
|
|
|
|
|
endif |
|
|
|
|
|
|
|
|
|
## Test python environment is setup correctly
|
|
|
|
|
test_environment: |
|
|
|
@ -114,4 +124,4 @@ show-help:
|
|
|
|
|
} \
|
|
|
|
|
printf "\n"; \
|
|
|
|
|
}' \
|
|
|
|
|
| more $(shell test $(shell uname) == Darwin && echo '--no-init --raw-control-chars')
|
|
|
|
|
| more $(shell test $(shell uname) == Darwin && echo '--no-init --raw-control-chars')
|
|
|
|
|