Created
August 23, 2019 13:43
-
-
Save sebmartin/0b17cc1d085b2ae77b12dd7499b7f13f to your computer and use it in GitHub Desktop.
Python project Makefile
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
VENV=.venv | |
PYVERSION=3.6.5 | |
${VENV}: | |
@which pyenv > /dev/null 2>&1 || (echo "Install pyenv (e.g. brew install pyenv)" && exit 1) | |
pyenv local ${PYVERSION} || pyenv install ${PYVERSION} && pyenv local ${PYVERSION} | |
virtualenv --version || pip install virtualenv | |
virtualenv ${VENV} | |
${VENV}/bin/activate: ${VENV} requirements.txt | |
. ${VENV}/bin/activate; pip install -r requirements.txt | |
touch ${VENV}/bin/activate | |
test: ${VENV} | |
. ${VENV}/bin/activate; py.test -vv tests | |
clean: | |
find . -name __pycache__ | xargs rm -rf | |
find . -name "*.pyc" | xargs rm -f | |
clean-env: clean | |
rm -rf ${VENV} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment