-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathMakefile
62 lines (50 loc) · 1.24 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
# This Makefile handles the following operations for face_mask_detector:
#
# - File formatting
# - Static type checking
# - Testing
# - Model training
# - Packaging
FORMATTER=black -l 90 face_mask_detector scripts test
# Check for correct formatting and perform type checking
.PHONY: check
check: check-format check-types
# Check for correct formatting
.PHONY: check-format
check-format:
$(FORMATTER) --check
# Perform static type checking
.PHONY: check-types
check-types:
mypy --strict face_mask_detector scripts
# Reformat files
.PHONY: reformat
reformat:
$(FORMATTER)
# Execute tests
.PHONY: test
test:
make -C test all
test-%:
make -C test $*
# Create a trained model
.PHONY: model
model:
python scripts/train_face_mask_detector.py -d dataset
# Prepare a release by generating distribution packages
.PHONY: prep-release
prep-release: clean
python setup.py sdist bdist_wheel
twine check dist/*
# Upload the distribution packages to TestPyPi
.PHONY: upload-test-release
upload-test-release: prep-release
twine upload --repository testpypi dist/*
# Upload the distribution packages to PyPi
.PHONY: upload-release
upload-release: prep-release
twine upload dist/*
.PHONY: clean
clean:
rm -rf sdist dist *.egg-info
pyclean $(CURDIR)