From: Paul Brossier Date: Sun, 15 May 2016 20:51:35 +0000 (+0200) Subject: setup.py: only generate source files in build_ext X-Git-Tag: 0.4.4~300^2~31 X-Git-Url: https://git.aubio.org/?p=aubio.git;a=commitdiff_plain;h=b1d37c0443da74f2ae5bfa21c6e3913ddc29b779 setup.py: only generate source files in build_ext --- diff --git a/setup.py b/setup.py index b46e04e6..e3489371 100755 --- a/setup.py +++ b/setup.py @@ -53,9 +53,6 @@ else: add_system_aubio(aubio_extension) -# generate files if they don't exit -aubio_extension.sources += generate_external(header, output_path, overwrite = False) - classifiers = [ 'Development Status :: 4 - Beta', 'Environment :: Console', @@ -71,6 +68,14 @@ classifiers = [ 'License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)', ] +from distutils.command.build_ext import build_ext as _build_ext +class build_ext(_build_ext): + + def build_extension(self, extension): + # generate files python/gen/*.c, python/gen/aubio-generated.h + extension.sources += generate_external(header, output_path, overwrite = False) + return _build_ext.build_extension(self, extension) + distrib = setup(name='aubio', version = __version__, packages = ['aubio'], @@ -91,6 +96,7 @@ distrib = setup(name='aubio', cmdclass = { 'clean': CleanGenerated, 'generate': GenerateCommand, + 'build_ext': build_ext, }, test_suite = 'nose2.collector.collector', )