-
Notifications
You must be signed in to change notification settings - Fork 61
/
Makefile
51 lines (43 loc) · 1.4 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
.PHONY: test clean install-dev requirements venv
#################################################################################
# GLOBALS #
#################################################################################
PACKAGE_NAME = carla
PYTHON = $(VENV_DIR)/bin/python
PIP = $(VENV_DIR)/bin/pip
VENV_DIR = env
CURRENT_DIR = $(shell pwd)
#################################################################################
# COMMANDS #
#################################################################################
## Run package
run:
$(PYTHON) carla/run.py
## Run python tests
test:
$(PYTHON) -m pytest test/*
## Delete all compiled Python files
clean:
find . -type f -name "*.py[co]" -delete
find . -type d -name "__pycache__" -delete
## Install development tools
install-dev: requirements
$(VENV_DIR)/bin/pre-commit install
## Install Python Dependencies
requirements: venv
$(PIP) install -U pip setuptools wheel
ifneq ($(wildcard ./setup.py),)
$(PIP) install -e .
endif
ifneq ($(wildcard ./requirements.txt),)
$(PIP) install -r requirements.txt
endif
ifneq ($(wildcard ./requirements-dev.txt),)
$(PIP) install -r requirements-dev.txt
endif
## Install virtual environment
venv:
ifeq ($(wildcard $(VENV_DIR)/*),)
mkdir -p $(VENV_DIR)
python3.7 -m venv $(VENV_DIR)
endif