python/tests/test_filterbank.py: check for wrong values
[aubio.git] / setup.py
1 #! /usr/bin/env python
2
3 import sys
4 import os.path
5 import numpy
6 from setuptools import setup, Extension
7 from python.lib.moresetuptools import CleanGenerated, GenerateCommand
8 # function to generate gen/*.{c,h}
9 from python.lib.gen_external import generate_external, header, output_path
10
11 # read from VERSION
12 for l in open('VERSION').readlines(): exec (l.strip())
13 __version__ = '.'.join \
14         ([str(x) for x in [AUBIO_MAJOR_VERSION, AUBIO_MINOR_VERSION, AUBIO_PATCH_VERSION]]) \
15         + AUBIO_VERSION_STATUS
16
17 include_dirs = []
18 library_dirs = []
19 define_macros = []
20 extra_link_args = []
21
22 include_dirs += [ 'python/ext' ]
23 include_dirs += [ output_path ] # aubio-generated.h
24 include_dirs += [ numpy.get_include() ]
25
26 if sys.platform.startswith('darwin'):
27     extra_link_args += ['-framework','CoreFoundation', '-framework','AudioToolbox']
28
29 if os.path.isfile('src/aubio.h'):
30     define_macros += [('USE_LOCAL_AUBIO', 1)]
31     include_dirs += ['src'] # aubio.h
32     library_dirs += ['build/src']
33
34 aubio_extension = Extension("aubio._aubio", [
35     "python/ext/aubiomodule.c",
36     "python/ext/aubioproxy.c",
37     "python/ext/ufuncs.c",
38     "python/ext/py-musicutils.c",
39     "python/ext/py-cvec.c",
40     "python/ext/py-filter.c",
41     "python/ext/py-filterbank.c",
42     "python/ext/py-fft.c",
43     "python/ext/py-phasevoc.c",
44     "python/ext/py-source.c",
45     "python/ext/py-sink.c",
46     # generate files if they don't exit
47     ] + generate_external(header, output_path, overwrite = False),
48     include_dirs = include_dirs,
49     library_dirs = library_dirs,
50     extra_link_args = extra_link_args,
51     define_macros = define_macros,
52     libraries=['aubio'])
53
54 classifiers = [
55     'Development Status :: 4 - Beta',
56     'Environment :: Console',
57     'Intended Audience :: Science/Research',
58     'Topic :: Software Development :: Libraries',
59     'Topic :: Multimedia :: Sound/Audio :: Analysis',
60     'Topic :: Multimedia :: Sound/Audio :: Sound Synthesis',
61     'Operating System :: POSIX',
62     'Operating System :: MacOS :: MacOS X',
63     'Operating System :: Microsoft :: Windows',
64     'Programming Language :: C',
65     'Programming Language :: Python',
66     'License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)',
67     ]
68
69 distrib = setup(name='aubio',
70     version = __version__,
71     packages = ['aubio'],
72     package_dir = {'aubio':'python/lib/aubio'},
73     scripts = ['python/scripts/aubiocut'],
74     ext_modules = [aubio_extension],
75     description = 'interface to the aubio library',
76     long_description = 'interface to the aubio library',
77     license = 'GNU/GPL version 3',
78     author = 'Paul Brossier',
79     author_email = 'piem@aubio.org',
80     maintainer = 'Paul Brossier',
81     maintainer_email = 'piem@aubio.org',
82     url = 'http://aubio.org/',
83     platforms = 'any',
84     classifiers = classifiers,
85     install_requires = ['numpy'],
86     cmdclass = {
87         'clean': CleanGenerated,
88         'generate': GenerateCommand,
89         },
90     test_suite = 'nose2.collector.collector',
91     )