generated from duckietown/template-library
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
121 lines (82 loc) · 2.35 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
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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
library_name=dt_computer_vision
tag=$(library_name)
regular_packages=$(library_name)
test_packages=$(library_name)_tests
cover_packages=$(test_packages),$(regular_packages)
CIRCLE_NODE_INDEX ?= 0
CIRCLE_NODE_TOTAL ?= 1
out=out
coverage_dir=$(out)/coverage
tr=$(out)/test-results
xunit_output=$(tr)/nose-$(CIRCLE_NODE_INDEX)-xunit.xml
parallel=--processes=8 --process-timeout=1000 --process-restartworker
coverage=--cover-html --cover-html-dir=$(coverage_dir) --cover-tests --with-coverage --cover-package=$(cover_packages)
xunitmp=--with-xunitmp --xunitmp-file=$(xunit_output)
extra=--rednose --immediate
all:
@echo "You can try:"
@echo
@echo " make build run"
@echo " make docs "
@echo " make test coverage-combine coverage-report"
@echo " "
@echo " make -C notebooks clean all"
black:
black -l 110 --target-version py37 src
clean:
coverage erase
rm -rf $(coverage_dir) $(tr)
test: clean
mkdir -p $(tr)
DISABLE_CONTRACTS=1 nose2 -v -s ./src
test-parallel: clean
mkdir -p $(tr)
DISABLE_CONTRACTS=1 nosetests $(extra) $(coverage) src -v --nologcapture $(parallel)
test-parallel-circle:
DISABLE_CONTRACTS=1 \
NODE_TOTAL=$(CIRCLE_NODE_TOTAL) \
NODE_INDEX=$(CIRCLE_NODE_INDEX) \
nosetests $(coverage) $(xunitmp) src $(parallel)
coverage-combine:
coverage combine
build:
docker build -t $(tag) .
build-no-cache:
docker build --no-cache -t $(tag) .
test-docker: build
docker run -it --rm -v $(PWD)/out:/library/out:rw $(tag) make test
test-docker-mounted-src:
docker run -it --rm \
-e DT_SUPERUSER=1 \
-v $(PWD)/out:/library/out:rw \
-v $(PWD)/assets:/library/assets:ro \
-v $(PWD)/src:/library/src:ro \
$(tag) \
make test
run:
mkdir -p out-docker
docker run -it -v $(PWD)/out-docker:/out $(tag) dt-pc-demo
run-with-mounted-src:
mkdir -p out-docker
docker run -it -v $(PWD)/src:/library/src:ro -v $(PWD)/out-docker:/out $(tag) dt-pc-demo
coverage-report:
coverage html -d $(coverage_dir)
docs:
sphinx-build src $(out)/docs
# Release code
bump-upload:
$(MAKE) bump
$(MAKE) upload
bump: # v2
bumpversion patch
git push --tags
git push
upload: # v3
dts build_utils check-not-dirty
dts build_utils check-tagged
dts build_utils check-need-upload --package duckietown-pondcleaner-ente make upload-do
upload-do:
rm -f dist/*
rm -rf src/*.egg-info
python3 setup.py sdist
twine upload --skip-existing --verbose dist/*