-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
111 lines (73 loc) · 2.11 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
tag=dt-maps
regular_packages=dt_maps
test_packages=dt_maps_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 $(out) $(coverage_dir) $(tr)
test: clean
mkdir -p $(tr)
DISABLE_CONTRACTS=1 nosetests $(extra) $(coverage) src -v -s --nologcapture $(xunitmp)
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 -v $(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 $(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:/dt-maps/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 dt-maps-daffy make upload-do
upload-do:
rm -f dist/*
rm -rf src/*.egg-info
python3 setup.py sdist
twine upload --skip-existing --verbose dist/*