-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
101 lines (75 loc) · 2.02 KB
/
Copy pathMakefile
File metadata and controls
101 lines (75 loc) · 2.02 KB
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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
# Fandango Makefile. For development only.
# Settings
MAKEFLAGS=--warn-undefined-variables
# Programs
PYTHON = python
PYTEST = pytest
ANTLR = antlr
BLACK = black
PIP = pip
SED = sed
PAGELABELS = $(PYTHON) -m pagelabels
REQUIREMENTS = requirements.txt
# Default targets
web: requirements.txt parser html
all: web pdf
.PHONY: web all parser install dev-tools docs html latex pdf
## Requirements
requirements.txt: pyproject.toml
pip-compile $<
# Install tools for development
UNAME := $(shell uname)
ifeq ($(UNAME), Darwin)
# Mac
SYSTEM_DEV_TOOLS = antlr pdftk-java graphviz
SYSTEM_DEV_INSTALL = brew install
else
# Linux
SYSTEM_DEV_TOOLS = antlr pdftk-java graphviz
SYSTEM_DEV_INSTALL = apt-get install
endif
dev-tools: system-dev-tools
pip install -U black
pip install -U jupyter-book pyppeteer ghp-import pagelabels
pip install -U graphviz
system-dev-tools:
$(SYSTEM_DEV_INSTALL) $(SYSTEM_DEV_TOOLS)
## Tests
TESTS = tests
TEST_SOURCES = $(wildcard $(TESTS)/*.py $(TESTS)/resources/*)
.PHONY: test tests
test tests:
$(PYTEST)
## Installation
.PHONY: install install-test install-tests
install:
$(PIP) install -r $(REQUIREMENTS)
$(PIP) install -e .
# We separate _installing_ from _running_ tests
# so we can run 'make tests' quickly (see above)
# without having to reinstall things
install-test install-tests:
$(PIP) install -r $(REQUIREMENTS)
$(PIP) install pytest
$(PIP) install -e ".[test]"
# Experiments
install-evaluation install-evaluations:
$(PIP) install -r $(REQUIREMENTS)
$(PIP) install -e ".[evaluation]"
# Uninstallation
uninstall:
$(PIP) uninstall -y fandango-learn
# python -m evaluation.vs_isla.run_evaluation
.PHONY: evaluation evaluate experiment experiments
evaluation evaluate:
$(PYTHON) -m evaluation.run_evaluation
experiment experiments:
$(PYTHON) -m evaluation.experiments.run_experiments
clean-pip:
$(PIP) freeze | xargs $(PIP) uninstall -y
build-docker:
docker build -t fandango-learn .
run-docker:
docker run -it fandango-learn /bin/bash
run-docker-eval:
docker run -it fandango-learn-eval /bin/bash