-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
34 lines (26 loc) · 889 Bytes
/
Makefile
File metadata and controls
34 lines (26 loc) · 889 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# Makefile derived from https://web.archive.org/web/20240205205603/https://venthur.de/2021-03-31-python-makefiles.html
# Get the directory this Makefile is sitting in
ROOT_DIR := $(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))
# system python interpreter. used only to create virtual environment
PY = python3
VENV = venv
BIN=$(ROOT_DIR)/$(VENV)/bin
all: pylint yamllint
$(VENV): src/requirements/ci.txt src/requirements/usage.txt
$(PY) -m venv $(VENV)
$(BIN)/pip install --upgrade -r src/requirements/ci.txt
$(BIN)/pip install --upgrade -r src/requirements/usage.txt
touch $(VENV)
.PHONY: pylint
pylint: $(VENV)
$(BIN)/pylint $(ROOT_DIR)/src/
.PHONY: yamllint
yamllint: $(VENV)
$(BIN)/yamllint .
.PHONY: run
run: $(VENV)
(cd src && $(BIN)/python odu.py $(ARGS))
clean:
rm -rf $(VENV)
find . -type f -name *.pyc -delete
find . -type d -name __pycache__ -delete