-
-
Save jonathantito/c381eeef53ffd9651c869eac8e6e2606 to your computer and use it in GitHub Desktop.
Makefile for Python virtualenv and pip dependency manifest. Assumes virtual environment will be created in a 'venv' subdirectory.
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
.PHONY: init_venv deps freeze clean_venv | |
all: init_venv deps | |
PYTHONPATH=venv ; . venv/bin/activate | |
init_venv: | |
if [ ! -e "venv/bin/activate_this.py" ] ; then PYTHONPATH=venv ; virtualenv --clear venv ; fi | |
deps: | |
PYTHONPATH=venv ; . venv/bin/activate && venv/bin/pip install -U -r requirements.txt && if [ "$(ls requirements)" ] ; then venv/bin/pip install -U -r requirements/* ; fi | |
freeze: | |
. venv/bin/activate && venv/bin/pip freeze > requirements.txt | |
clean_venv: | |
rm -rf venv |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment