Last active
June 22, 2022 19:47
-
-
Save Sigmanificient/8e9f640ea01a60fda67e9ccb82b0f64e to your computer and use it in GitHub Desktop.
Makefile for python & pytest package
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
all: start | |
PKG = | |
VENV = venv | |
VBIN = $(VENV)/bin | |
TEST = tests | |
$(VBIN)/python: | |
python3 -m venv venv | |
chmod +x $(VBIN)/activate | |
./$(VBIN)/activate | |
$(VBIN)/pip install -r requirements.txt | |
$(VBIN)/pip install -e . | |
$(VBIN)/pytest: $(VBIN)/python | |
$(VBIN)/pip install -r $(TEST)/requirements.txt | |
$(VBIN)/pytest $(TEST) | |
start: $(VBIN)/python | |
$(VBIN)/python $(PKG) | |
test: $(VBIN)/pytest | |
cov: $(VBIN)/pytest $(VBIN)/coverage | |
$(VBIN)/pytest $(TEST) --cov=$(PKG) | |
$(VBIN)/python -m coverage xml -o coverage.xml | |
clean: | |
rm -rf venv | |
rm -rf *.-egg-info | |
.PHONY: all start clean test cov |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment