Tune debug mode

This commit is contained in:
Roman Mogilatov 2016-11-03 00:06:14 +02:00
parent aac72ed3a3
commit 4823278f11

View File

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