12
12
export PATH := $(abspath ${VENVBIN}) :${PATH}
13
13
14
14
15
- .PHONY : init test build benchmark publish ${VENV} -init
15
+ .PHONY : init test build benchmark publish venv -init
16
16
17
17
# Default target executed when no arguments are given to make.
18
18
default_target : build test
@@ -25,30 +25,36 @@ help: ## Show this help
25
25
all : depend build test # # Get dependencies, clean, build and test
26
26
27
27
build : ${VENV} clean # # Clean and build
28
- ${PYTHON} setup.py bdist_wheel
28
+ set -e ; \
29
+ ${PYTHON} setup.py bdist_wheel ; \
29
30
ls -lh dist
30
31
31
32
${VENV} : ${VENVBIN}/activate
32
33
33
- ${VENV}-init :
34
- if [ ! -d " ${VENV} " ] ; then ${PYTHON} -m virtualenv ${VENV} ; fi
34
+ venv-init :
35
+ ${PIP} install --user virtualenv
36
+ ${PYTHON} -m virtualenv ${VENV}
35
37
36
38
# remove packages not in the requirements.txt
37
39
# install and upgrade based on the requirements.txt
38
40
# let make know this is the last time requirements changed
39
- ${VENVBIN}/activate : ${VENV}-init requirements.txt
41
+ ${VENVBIN}/activate : requirements.txt
40
42
set -e ; \
43
+ if [ ! -d " ${VENV} " ] ; then make venv-init ; fi ; \
41
44
${PIP} freeze | grep -v -f requirements.txt - | grep -v ' ^#' | grep -v ' ^-e ' | xargs ${PIP} uninstall -y || echo " never mind" ; \
42
45
${PIP} install --upgrade -r requirements.txt ; \
43
46
touch ${VENVBIN} /activate
44
47
45
48
depend : ${VENV} # # Prepare dependencies
49
+ set -e ; \
46
50
${PYTHON} download-c-lib.py
47
51
48
52
test : ${VENV} # # Test all targets
53
+ set -e ; \
49
54
${PYTHON} -m pytest --capture=no --verbose
50
55
51
56
benchmark : ${VENV} # # Run CRUD benchmarks
57
+ set -e ; \
52
58
${PYTHON} -m benchmark
53
59
54
60
clean : # # Clean build artifacts
@@ -57,4 +63,5 @@ clean: ## Clean build artifacts
57
63
rm -rf * .egg-info
58
64
59
65
publish : # # Publish the package built by `make build`
66
+ set -e ; \
60
67
${PYTHON} -m twine upload --verbose dist/objectbox* .whl
0 commit comments