3 import sys, os.path, glob
4 from setuptools import setup, Extension
6 # add ./python/lib to current path
7 sys.path.append(os.path.join('python', 'lib'))
8 from moresetuptools import build_ext, CleanGenerated
10 # function to generate gen/*.{c,h}
11 from this_version import get_aubio_version, get_aubio_pyversion
13 __version__ = get_aubio_pyversion()
14 __aubio_version__ = get_aubio_version()
18 define_macros = [('AUBIO_VERSION', '%s' % __aubio_version__)]
21 include_dirs += [ 'python/ext' ]
24 include_dirs += [ numpy.get_include() ]
28 if sys.platform.startswith('darwin'):
29 extra_link_args += ['-framework','CoreFoundation', '-framework','AudioToolbox']
31 sources = sorted(glob.glob(os.path.join('python', 'ext', '*.c')))
33 aubio_extension = Extension("aubio._aubio",
35 include_dirs = include_dirs,
36 library_dirs = library_dirs,
37 extra_link_args = extra_link_args,
38 define_macros = define_macros)
40 if os.path.isfile('src/aubio.h'):
41 if not os.path.isdir(os.path.join('build','src')):
43 #__version__ += 'a2' # python only version
46 'Development Status :: 4 - Beta',
47 'Environment :: Console',
48 'Intended Audience :: Science/Research',
49 'Topic :: Software Development :: Libraries',
50 'Topic :: Multimedia :: Sound/Audio :: Analysis',
51 'Topic :: Multimedia :: Sound/Audio :: Sound Synthesis',
52 'Operating System :: POSIX',
53 'Operating System :: MacOS :: MacOS X',
54 'Operating System :: Microsoft :: Windows',
55 'Programming Language :: C',
56 'Programming Language :: Python',
57 'License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)',
60 distrib = setup(name='aubio',
61 version = __version__,
63 package_dir = {'aubio':'python/lib/aubio'},
64 ext_modules = [aubio_extension],
65 description = 'a collection of tools for music analysis',
66 long_description = 'a collection of tools for music analysis',
67 license = 'GNU/GPL version 3',
68 author = 'Paul Brossier',
69 author_email = 'piem@aubio.org',
70 maintainer = 'Paul Brossier',
71 maintainer_email = 'piem@aubio.org',
72 url = 'https://aubio.org/',
74 classifiers = classifiers,
75 install_requires = ['numpy'],
76 setup_requires = ['numpy'],
78 'clean': CleanGenerated,
79 'build_ext': build_ext,
83 'aubio = aubio.cmd:main',
84 'aubiocut = aubio.cut:main',
87 test_suite = 'nose2.collector.collector',