mirror of
https://github.com/ets-labs/python-dependency-injector.git
synced 2024-11-22 01:26:51 +03:00
Add creation of debug builds
This commit is contained in:
parent
02b993ec54
commit
e5498f214b
|
@ -1,6 +1,6 @@
|
||||||
[run]
|
[run]
|
||||||
|
plugins = Cython.Coverage
|
||||||
include = dependency_injector/*
|
include = dependency_injector/*
|
||||||
omit = tests/*
|
|
||||||
|
|
||||||
[html]
|
[html]
|
||||||
directory=reports/unittests/
|
directory=reports/unittests/
|
||||||
|
|
|
@ -3,7 +3,7 @@ language: python
|
||||||
install:
|
install:
|
||||||
- pip install tox
|
- pip install tox
|
||||||
- pip install cython
|
- pip install cython
|
||||||
- make compile
|
- make build DEBUG=1
|
||||||
script:
|
script:
|
||||||
- tox
|
- tox
|
||||||
python:
|
python:
|
||||||
|
|
29
Makefile
29
Makefile
|
@ -1,4 +1,15 @@
|
||||||
VERSION:=$(shell python setup.py --version)
|
VERSION := $(shell python setup.py --version)
|
||||||
|
|
||||||
|
CYTHON_SRC := $(shell find dependency_injector -name '*.pyx')
|
||||||
|
|
||||||
|
CYTHON_DIRECTIVES =
|
||||||
|
C_MACROS =
|
||||||
|
|
||||||
|
ifdef DEBUG
|
||||||
|
CYTHON_DIRECTIVES += -Xprofile=True -Xlinetrace=True
|
||||||
|
C_MACROS += -DCYTHON_TRACE
|
||||||
|
endif
|
||||||
|
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
# Clean sources
|
# Clean sources
|
||||||
|
@ -6,6 +17,7 @@ clean:
|
||||||
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
|
||||||
|
find dependency_injector -name '*.html' -delete
|
||||||
# Clean tests
|
# Clean tests
|
||||||
find tests -name '*.py[co]' -delete
|
find tests -name '*.py[co]' -delete
|
||||||
find tests -name '__pycache__' -delete
|
find tests -name '__pycache__' -delete
|
||||||
|
@ -13,24 +25,25 @@ clean:
|
||||||
find examples -name '*.py[co]' -delete
|
find examples -name '*.py[co]' -delete
|
||||||
find examples -name '__pycache__' -delete
|
find examples -name '__pycache__' -delete
|
||||||
|
|
||||||
compile: clean
|
cythonize:
|
||||||
# Compile Cython to C
|
# Compile Cython to C
|
||||||
cython -a dependency_injector/injections.pyx
|
cython -a $(CYTHON_DIRECTIVES) $(CYTHON_SRC)
|
||||||
# Move all Cython html reports
|
# Move all Cython html reports
|
||||||
mkdir -p reports/cython/
|
mkdir -p reports/cython/
|
||||||
find dependency_injector -name '*.html' -exec mv {} reports/cython/ \;
|
find dependency_injector -name '*.html' -exec mv {} reports/cython/ \;
|
||||||
|
|
||||||
build: compile
|
build: clean cythonize
|
||||||
# Compile C extensions
|
# Compile C extensions
|
||||||
python setup.py build_ext --inplace
|
python setup.py build_ext --inplace $(C_MACROS)
|
||||||
|
|
||||||
tests: build
|
test:
|
||||||
# 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
|
||||||
coverage report --rcfile=./.coveragerc
|
coverage report --rcfile=./.coveragerc
|
||||||
coverage html --rcfile=./.coveragerc
|
coverage html --rcfile=./.coveragerc
|
||||||
coverage erase
|
|
||||||
|
check:
|
||||||
# Static analysis
|
# Static analysis
|
||||||
flake8 --max-complexity=10 dependency_injector/
|
flake8 --max-complexity=10 dependency_injector/
|
||||||
flake8 --max-complexity=10 examples/
|
flake8 --max-complexity=10 examples/
|
||||||
|
@ -38,7 +51,7 @@ tests: build
|
||||||
pydocstyle dependency_injector/
|
pydocstyle dependency_injector/
|
||||||
pydocstyle examples/
|
pydocstyle examples/
|
||||||
|
|
||||||
publish: build tests
|
publish: cythonize
|
||||||
# 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
|
||||||
|
|
Loading…
Reference in New Issue
Block a user