Last active
March 18, 2022 10:44
-
-
Save zedr/69d0bade64b96ff53dc66a7c6fa7d48a to your computer and use it in GitHub Desktop.
A make file for Python projects
This file contains hidden or 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: default clean deps | |
ENV=.env | |
_PYTHON=python3 | |
PYTHON_VERSION=$(shell ${_PYTHON} -V | cut -d " " -f 2 | cut -d "." -f1-2) | |
SITE_PACKAGES=${ENV}/lib/python${PYTHON_VERSION}/site-packages | |
PYTHON=${ENV}/bin/python3 | |
IN_ENV=source ${ENV}/bin/activate ; | |
default: deps | |
${PYTHON}: | |
@echo "Creating Python ${PYTHON_VERSION} environment..." >&2 | |
@${_PYTHON} -m venv ${ENV} | |
deps: ${PYTHON} | |
@echo "Checking for updates to pip..." >&2 | |
@${PYTHON} -m pip install -U pip | |
@echo "Installing dependencies..." >&2 | |
@${PYTHON} -m pip install -r requirements.txt | |
clean: | |
@rm -rf .env |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment