-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
87 lines (74 loc) · 2.65 KB
/
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
NAME := jumpstreet
INSTALL_STAMP := .install.stamp
POETRY := $(shell command -v poetry 2> /dev/null)
PLATFORM?=desktop
CCONF?=camera
.DEFAULT_GOAL := help
.PHONY: help
help:
@echo "Please use 'make <target>' where <target> is one of"
@echo ""
@echo " install install packages and prepare environment"
@echo " clean remove all temporary files"
@echo " lint run the code linters"
@echo " format reformat code"
@echo " test run all the tests"
@echo ""
@echo "Check the Makefile to know exactly what each target is doing."
install: $(INSTALL_STAMP)
$(INSTALL_STAMP): pyproject.toml poetry.lock
@if [ -z $(POETRY) ]; then echo "Poetry could not be found. See https://python-poetry.org/docs/"; exit 2; fi
$(POETRY) install
touch $(INSTALL_STAMP)
.PHONY: clean
clean:
find . -type d -name "__pycache__" | xargs rm -rf {};
rm -rf $(INSTALL_STAMP) .coverage .mypy_cache
.PHONY: lint
lint: $(INSTALL_STAMP)
$(POETRY) run isort --profile=black --lines-after-imports=2 --check-only ./tests/ $(NAME)
$(POETRY) run black --check ./tests/ $(NAME) --diff
$(POETRY) run flake8 --ignore=W503,E501 ./tests/ $(NAME)
$(POETRY) run mypy ./tests/ $(NAME) --ignore-missing-imports
$(POETRY) run bandit -r $(NAME) -s B608
.PHONY: format
format: $(INSTALL_STAMP)
$(POETRY) run isort --profile=black --lines-after-imports=2 ./tests/ $(NAME)
$(POETRY) run black ./tests/ $(NAME)
.PHONY: test
test: $(INSTALL_STAMP)
$(POETRY) run pytest ./tests/ --cov-report term-missing --cov-fail-under 0 --cov $(NAME)
.PHONY: controller
controller: $(INSTALL_STAMP)
$(POETRY) run python jumpstreet/controller.py \
--config controller/$(PLATFORM)_$(CCONF).yml
.PHONY: mot15_replay
mot15_replay: $(INSTALL_STAMP)
$(POETRY) run python jumpstreet/sensors/run.py \
--config sensors/MOT15-replay.yml \
--sensor_id camera_1
.PHONY: nuscenes_replay
nuscenes_replay: $(INSTALL_STAMP)
$(POETRY) run python jumpstreet/sensors/run.py \
--config sensors/nuScenes-camera-replay.yml \
--sensor_id camera_1
.PHONY: kitti_replay
kitti_replay: $(INSTALL_STAMP)
$(POETRY) run python jumpstreet/sensors/run.py \
--config sensors/kitti-camera-replay.yml \
--sensor_id camera_1
.PHONY: carla_replay
carla_replay: $(INSTALL_STAMP)
$(POETRY) run python jumpstreet/sensors/run.py \
--config sensors/carla-camera-replay.yml \
--sensor_id camera_1
.PHONY: flir
flir: $(INSTALL_STAMP)
$(POETRY) run python jumpstreet/sensors/run.py \
--config sensors/FLIR-BFS-50S50C.yml \
--sensor_id camera_1
.PHONY: ti_radar
ti_radar: $(INSTALL_STAMP)
$(POETRY) run python jumpstreet/sensors/run.py \
--config sensors/TI-1443-radar.yml \
--sensor_id radar_1