Add build command to makefile

This commit is contained in:
Roman Mogilatov 2016-10-31 11:30:57 +02:00
parent 83684f01d3
commit d594f8018a

View File

@ -2,7 +2,7 @@ VERSION:=$(shell python setup.py --version)
clean: clean:
# Clean sources # Clean sources
find dependency_injector -name '*.py[co]' -delete find dependency_injector -name '*.py[cod]' -delete
find dependency_injector -name '__pycache__' -delete find dependency_injector -name '__pycache__' -delete
find dependency_injector -name '*.c' -delete find dependency_injector -name '*.c' -delete
find dependency_injector -name '*.so' -delete find dependency_injector -name '*.so' -delete
@ -13,7 +13,18 @@ clean:
find examples -name '*.py[co]' -delete find examples -name '*.py[co]' -delete
find examples -name '__pycache__' -delete find examples -name '__pycache__' -delete
tests: clean compile: clean
# Compile Cython to C
cython -a dependency_injector/injections.pyx
# Move all Cython html reports
mkdir -p reports/cython/
find dependency_injector -name '*.html' -exec mv {} reports/cython/ \;
build: compile
# Compile C extensions
python setup.py build_ext --inplace
tests: build
# Unit tests with coverage report # Unit tests with coverage report
coverage erase coverage erase
coverage run --rcfile=./.coveragerc -m unittest2 discover tests coverage run --rcfile=./.coveragerc -m unittest2 discover tests
@ -27,7 +38,7 @@ tests: clean
pydocstyle dependency_injector/ pydocstyle dependency_injector/
pydocstyle examples/ pydocstyle examples/
publish: clean publish: build tests
# Create and upload build # Create and upload build
python setup.py sdist upload python setup.py sdist upload
# Create and upload tag # Create and upload tag