mirror of
https://github.com/ets-labs/python-dependency-injector.git
synced 2025-02-06 22:50:52 +03:00
Tune building in debug mode
This commit is contained in:
parent
d8f44948a4
commit
3bd19a168a
|
@ -3,13 +3,13 @@ language: python
|
||||||
install:
|
install:
|
||||||
- pip install tox
|
- pip install tox
|
||||||
- pip install cython
|
- pip install cython
|
||||||
- make build
|
- make cythonize
|
||||||
script:
|
script:
|
||||||
- tox
|
- tox
|
||||||
python:
|
python:
|
||||||
- 3.5
|
- 3.5
|
||||||
env:
|
env:
|
||||||
- TOXENV=coveralls DEBUG=1
|
- TOXENV=coveralls DEPENDENCY_INJECTOR_DEBUG_MODE=1
|
||||||
- TOXENV=pylint
|
- TOXENV=pylint
|
||||||
- TOXENV=flake8
|
- TOXENV=flake8
|
||||||
- TOXENV=pydocstyle
|
- TOXENV=pydocstyle
|
||||||
|
|
5
Makefile
5
Makefile
|
@ -5,9 +5,8 @@ CYTHON_SRC := $(shell find dependency_injector -name '*.pyx')
|
||||||
CYTHON_DIRECTIVES =
|
CYTHON_DIRECTIVES =
|
||||||
C_MACROS =
|
C_MACROS =
|
||||||
|
|
||||||
ifdef DEBUG
|
ifdef DEPENDENCY_INJECTOR_DEBUG_MODE
|
||||||
CYTHON_DIRECTIVES += -Xprofile=True -Xlinetrace=True
|
CYTHON_DIRECTIVES += -Xprofile=True -Xlinetrace=True
|
||||||
C_MACROS += -DCYTHON_TRACE
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|
||||||
|
@ -34,7 +33,7 @@ cythonize:
|
||||||
|
|
||||||
build: clean cythonize
|
build: clean cythonize
|
||||||
# Compile C extensions
|
# Compile C extensions
|
||||||
python setup.py build_ext --inplace $(C_MACROS)
|
python setup.py build_ext --inplace
|
||||||
|
|
||||||
test:
|
test:
|
||||||
# Unit tests with coverage report
|
# Unit tests with coverage report
|
||||||
|
|
9
setup.py
9
setup.py
|
@ -1,5 +1,6 @@
|
||||||
"""`Dependency injector` setup script."""
|
"""`Dependency injector` setup script."""
|
||||||
|
|
||||||
|
import os
|
||||||
import re
|
import re
|
||||||
|
|
||||||
from setuptools import setup, Extension
|
from setuptools import setup, Extension
|
||||||
|
@ -17,6 +18,13 @@ with open('requirements.txt') as version:
|
||||||
with open('dependency_injector/__init__.py') as init_file:
|
with open('dependency_injector/__init__.py') as init_file:
|
||||||
version = re.search('VERSION = \'(.*?)\'', init_file.read()).group(1)
|
version = re.search('VERSION = \'(.*?)\'', init_file.read()).group(1)
|
||||||
|
|
||||||
|
# Defining macros:
|
||||||
|
defined_macros = list()
|
||||||
|
if os.environ.get('DEPENDENCY_INJECTOR_DEBUG_MODE') == '1':
|
||||||
|
defined_macros.append(('CYTHON_TRACE', 1))
|
||||||
|
defined_macros.append(('CYTHON_TRACE_NOGIL', 1))
|
||||||
|
print(defined_macros)
|
||||||
|
|
||||||
|
|
||||||
setup(name='dependency-injector',
|
setup(name='dependency-injector',
|
||||||
version=version,
|
version=version,
|
||||||
|
@ -36,6 +44,7 @@ setup(name='dependency-injector',
|
||||||
ext_modules=[
|
ext_modules=[
|
||||||
Extension('dependency_injector.injections',
|
Extension('dependency_injector.injections',
|
||||||
['dependency_injector/injections.c'],
|
['dependency_injector/injections.c'],
|
||||||
|
define_macros=defined_macros,
|
||||||
extra_compile_args=['-O2']),
|
extra_compile_args=['-O2']),
|
||||||
],
|
],
|
||||||
package_data={
|
package_data={
|
||||||
|
|
8
tox.ini
8
tox.ini
|
@ -18,18 +18,18 @@ deps=
|
||||||
coveralls
|
coveralls
|
||||||
commands=
|
commands=
|
||||||
coverage erase
|
coverage erase
|
||||||
coverage run --rcfile=./.coveragerc -m unittest2 discover tests []
|
coverage run --rcfile=./.coveragerc -m unittest2 discover tests
|
||||||
coveralls
|
coveralls
|
||||||
|
|
||||||
[testenv:pylint]
|
[testenv:pylint]
|
||||||
basepython=python2.7
|
basepython=python3.5
|
||||||
deps=
|
deps=
|
||||||
pylint
|
pylint
|
||||||
commands=
|
commands=
|
||||||
- pylint -f colorized --rcfile=./.pylintrc dependency_injector
|
- pylint -f colorized --rcfile=./.pylintrc dependency_injector
|
||||||
|
|
||||||
[testenv:flake8]
|
[testenv:flake8]
|
||||||
basepython=python2.7
|
basepython=python3.5
|
||||||
deps=
|
deps=
|
||||||
flake8
|
flake8
|
||||||
commands=
|
commands=
|
||||||
|
@ -37,7 +37,7 @@ commands=
|
||||||
flake8 --max-complexity=10 examples/
|
flake8 --max-complexity=10 examples/
|
||||||
|
|
||||||
[testenv:pydocstyle]
|
[testenv:pydocstyle]
|
||||||
basepython=python2.7
|
basepython=python3.5
|
||||||
deps=
|
deps=
|
||||||
pydocstyle
|
pydocstyle
|
||||||
commands=
|
commands=
|
||||||
|
|
Loading…
Reference in New Issue
Block a user