1212export PATH := $(abspath ${VENVBIN}) :${PATH}
1313
1414
15- .PHONY : init test build benchmark publish ${VENV} -init
15+ .PHONY : init test build benchmark publish venv -init
1616
1717# Default target executed when no arguments are given to make.
1818default_target : build test
@@ -25,30 +25,36 @@ help: ## Show this help
2525all : depend build test # # Get dependencies, clean, build and test
2626
2727build : ${VENV} clean # # Clean and build
28- ${PYTHON} setup.py bdist_wheel
28+ set -e ; \
29+ ${PYTHON} setup.py bdist_wheel ; \
2930 ls -lh dist
3031
3132${VENV} : ${VENVBIN}/activate
3233
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}
3537
3638# remove packages not in the requirements.txt
3739# install and upgrade based on the requirements.txt
3840# let make know this is the last time requirements changed
39- ${VENVBIN}/activate : ${VENV}-init requirements.txt
41+ ${VENVBIN}/activate : requirements.txt
4042 set -e ; \
43+ if [ ! -d " ${VENV} " ] ; then make venv-init ; fi ; \
4144 ${PIP} freeze | grep -v -f requirements.txt - | grep -v ' ^#' | grep -v ' ^-e ' | xargs ${PIP} uninstall -y || echo " never mind" ; \
4245 ${PIP} install --upgrade -r requirements.txt ; \
4346 touch ${VENVBIN} /activate
4447
4548depend : ${VENV} # # Prepare dependencies
49+ set -e ; \
4650 ${PYTHON} download-c-lib.py
4751
4852test : ${VENV} # # Test all targets
53+ set -e ; \
4954 ${PYTHON} -m pytest --capture=no --verbose
5055
5156benchmark : ${VENV} # # Run CRUD benchmarks
57+ set -e ; \
5258 ${PYTHON} -m benchmark
5359
5460clean : # # Clean build artifacts
@@ -57,4 +63,5 @@ clean: ## Clean build artifacts
5763 rm -rf * .egg-info
5864
5965publish : # # Publish the package built by `make build`
66+ set -e ; \
6067 ${PYTHON} -m twine upload --verbose dist/objectbox* .whl
0 commit comments