-
Notifications
You must be signed in to change notification settings - Fork 22
/
Copy pathMakefile
49 lines (39 loc) · 1.13 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
VENV_NAME ?= .venv
VENV_ACTIVATE = . $(VENV_NAME)/bin/activate
.DEFAULT_GOAL := help
.PHONY: init
init: venv
.PHONY: help
help:
@echo "Targets:"
@echo " requirements Installs dependencies"
@echo " venv Creates a virtual environment and install dependencies"
@echo " test Run pytest on the tests/ directory"
@echo " lint Check code with flake8 and black"
@echo " format Format code with black"
.PHONY: requirements
requirements:
$(VENV_ACTIVATE); pip install -r requirements.txt
.PHONY: venv
venv:
test -d $(VENV_NAME) || python3 -m venv $(VENV_NAME)
$(VENV_ACTIVATE); pip install -r requirements.txt
.PHONY: test
test: venv
$(VENV_ACTIVATE); pytest tests/
test-harness:
git submodule update --init
.PHONY: lint
lint: venv
$(VENV_ACTIVATE); flake8 .
$(VENV_ACTIVATE); isort .
$(VENV_ACTIVATE); black --check .
.PHONY: format
format: venv
$(VENV_ACTIVATE); black .
.PHONY: e2e
e2e: venv test-harness
# NOTE: only the evaluation feature is run for now
cp test-harness/features/evaluation.feature tests/features/
$(VENV_ACTIVATE); behave tests/features/
rm tests/features/*.feature