Last active
February 14, 2020 09:08
-
-
Save ticapix/ec2d5bf51d603ae52e96a81679dcb627 to your computer and use it in GitHub Desktop.
Stub for python 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
ROOT_DIR:=$(shell dirname $(realpath $(lastword $(MAKEFILE_LIST)))) | |
PYTHON3=python3 | |
VENV_DIR=$(ROOT_DIR)/venv3 | |
NAME=$(shell basename $(ROOT_DIR)) | |
ECHO=@echo | |
RM=rm -rf | |
.PHONY: help | |
help: | |
$(ECHO) "$(NAME)" | |
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-15s\033[0m=> %s\n", $$1, $$2}' | |
$(VENV_DIR): | |
$(PYTHON3) -m venv $(VENV_DIR) | |
$(VENV_DIR)/bin/pip install --upgrade pip | |
$(VENV_DIR)/bin/pip install -Ur requirements.txt | |
deps: $(VENV_DIR) ## install dependencies | |
run: deps ## run | |
$(VENV_DIR)/bin/python $(ROOT_DIR)/XXX | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment