Tune debug mode

This commit is contained in:
Roman Mogilatov 2016-11-03 00:06:14 +02:00
parent aac72ed3a3
commit 4823278f11
1 changed files with 9 additions and 5 deletions

View File

@ -6,6 +6,10 @@ import re
from setuptools import setup, Extension
# Defining setup variables:
defined_macros = list()
package_data = dict([('dependency_injector', ['*.pxd'])])
# Getting description:
with open('README.rst') as readme_file:
description = readme_file.read()
@ -18,12 +22,14 @@ with open('requirements.txt') as version:
with open('src/dependency_injector/__init__.py') as init_file:
version = re.search('VERSION = \'(.*?)\'', init_file.read()).group(1)
# Defining macros:
defined_macros = list()
# Adding debug options:
if os.environ.get('DEPENDENCY_INJECTOR_DEBUG_MODE') == '1':
defined_macros.append(('CYTHON_TRACE', 1))
defined_macros.append(('CYTHON_TRACE_NOGIL', 1))
package_data['dependency_injector'].append('*.pyx')
package_data['dependency_injector'].append('*.c')
setup(name='dependency-injector',
version=version,
@ -49,9 +55,7 @@ setup(name='dependency-injector',
define_macros=defined_macros,
extra_compile_args=['-O2']),
],
package_data={
'dependency_injector': ['*.pxd']
},
package_data=package_data,
zip_safe=True,
license='BSD New',
platforms=['any'],