-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
49 lines (37 loc) · 1009 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
47
48
49
.PHONY: lint test lint-fix code-quality run build-image run-image clean
SRC_DIR = .
IMAGE_NAME ?= quay.io/rose/rose-game-engine
PORT ?= 8880
# Default driver when running on localhost
DRIVERS ?= http://127.0.0.1:8081
# By default, run both linting and tests
all: lint test
lint:
@echo "Running linting..."
flake8 --show-source --statistics .
black --check --diff .
lint-fix:
@echo "Running lint fixing..."
black --verbose --color .
code-quality:
@echo "Running static code quality checks..."
radon cc .
radon mi .
test:
@echo "Running unittests..."
pytest
run:
@echo "Running driver logic server ..."
python main.py --port $(PORT) --drivers $(DRIVERS)
build-image:
@echo "Building container image ..."
podman build -t $(IMAGE_NAME) .
run-image:
@echo "Running container image ..."
podman run --rm --network host -it $(IMAGE_NAME)
clean:
-rm -rf .coverage
-rm -rf htmlcov
-rm -rf .pytest_cache
-find . -name '*.pyc' -exec rm {} \;
-find . -name '__pycache__' -exec rmdir {} \;