-
Notifications
You must be signed in to change notification settings - Fork 6
/
Makefile
53 lines (38 loc) · 1.16 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
.PHONY: all docs test compile upload_to_pypi typecheck clean format
LIBRARY_DIR := epic_kitchens
SRC_FILES := $(shell find epic_kitchens)
SRC_FILES += setup.py
SYSTEM_TEST_DATASET_URL := "https://s3-eu-west-1.amazonaws.com/wp-research-public/epic/system_test_dataset.zip"
SYSTEM_TEST_DATASET_ETAG := $(shell cat tests/system_test_dataset.etag)
all: test
docs:
$(MAKE) html -C docs
test: compile tests/dataset
tox
tests/dataset: tests/system_test_dataset.zip
mkdir -p "$@"
unzip -o "$<" -d "$@"
touch "$@" # Update creation time of folder to prevent rule from rerunning
tests/system_test_dataset.zip: tests/system_test_dataset.etag
if [ -f "$@" ]; then\
curl "$(SYSTEM_TEST_DATASET_URL)" -o "$@" --header "If-None-Match: $(SYSTEM_TEST_DATASET_ETAG)";\
else\
curl "$(SYSTEM_TEST_DATASET_URL)" -o "$@";\
fi
compile:
python -m compileall $(LIBRARY_DIR) -j $$(nproc)
format:
black epic_kitchens tests setup.py
flake8:
flake8 epic_kitchens
dist: $(SRC_FILES) compile
rm -rf dist
python setup.py sdist
dist-upload: dist
twine upload dist/*
upload_to_pypi: dist
twine upload dist/*
typecheck:
mypy $(LIBRARY_DIR) --ignore-missing-imports
clean:
rm -rf dist build