-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
47 lines (37 loc) · 797 Bytes
/
Makefile
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
35
36
37
38
39
40
41
42
43
44
45
46
# Detect OS for venv differences
OS=$(shell uname -s)
ifeq ($(OS),Linux)
VENV=.venv/bin
else ifeq ($(OS),Darwin)
VENV=.venv/bin
else
VENV=.venv/Scripts
endif
# Do the normal QA, similar to the GH action
all: requirements lint test
# Lint using ruff. Will not break build
lint:
-${VENV}/ruff check --target-version py310 .
# Run pytests with proper output
test:
${VENV}/pytest -v -s
# Run hellsnake :D
run: requirements
${VENV}/python hell_snake.py
# Use make init to initialize venv
init: requirements
.venv:
python -m venv .venv
# Install/Update requirements
.PHONY: requirements
requirements: .venv
${VENV}/pip install -r requirements.txt
# Clean the venv
clean:
ifeq ($(OS),Linux)
rm -rf .venv
else ifeq ($(OS),Darwin)
rm -rf .venv
else
rm -r .venv
endif