Skip to content

Instantly share code, notes, and snippets.

@Sigmanificient
Last active June 22, 2022 19:47
Show Gist options
  • Save Sigmanificient/8e9f640ea01a60fda67e9ccb82b0f64e to your computer and use it in GitHub Desktop.
Save Sigmanificient/8e9f640ea01a60fda67e9ccb82b0f64e to your computer and use it in GitHub Desktop.
Makefile for python & pytest package
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