source: setup.py @ 2b3c438

feature/autosinkfeature/cnnfeature/cnn_orgfeature/constantqfeature/crepefeature/crepe_orgfeature/pitchshiftfeature/pydocstringsfeature/timestretchfix/ffmpeg5sampleryinfft+
Last change on this file since 2b3c438 was 2e40231, checked in by Paul Brossier <piem@piem.org>, 8 years ago

setup.py, python/lib/: use sorted glob.glob to improve reproducibility

  • Property mode set to 100755
File size: 2.9 KB
RevLine 
[9aa0af3]1#! /usr/bin/env python
[c71e405]2
[2675227]3import sys, os.path, glob
[1167631]4from setuptools import setup, Extension
[2675227]5from python.lib.moresetuptools import *
[1167631]6# function to generate gen/*.{c,h}
7from python.lib.gen_external import generate_external, header, output_path
[012b324]8
[945e26d]9# read from VERSION
[ad5203c]10for l in open('VERSION').readlines(): exec (l.strip())
[416ddd1]11
12if AUBIO_MAJOR_VERSION is None or AUBIO_MINOR_VERSION is None \
13        or AUBIO_PATCH_VERSION is None:
14    raise SystemError("Failed parsing VERSION file.")
15
16__version__ = '.'.join(map(str, [AUBIO_MAJOR_VERSION,
17                                 AUBIO_MINOR_VERSION,
18                                 AUBIO_PATCH_VERSION]))
19if AUBIO_VERSION_STATUS is not None:
20    if AUBIO_VERSION_STATUS.startswith('~'):
21        AUBIO_VERSION_STATUS = AUBIO_VERSION_STATUS[1:]
22    __version__ += AUBIO_VERSION_STATUS
[945e26d]23
[41399bd]24include_dirs = []
25library_dirs = []
26define_macros = []
[4d3b573]27extra_link_args = []
[012b324]28
[1167631]29include_dirs += [ 'python/ext' ]
[a89ed31]30include_dirs += [ output_path ] # aubio-generated.h
[5f6324e]31try:
32    import numpy
33    include_dirs += [ numpy.get_include() ]
34except ImportError:
35    pass
[ad5203c]36
[4d3b573]37if sys.platform.startswith('darwin'):
38    extra_link_args += ['-framework','CoreFoundation', '-framework','AudioToolbox']
39
[2e40231]40sources = sorted(glob.glob(os.path.join('python', 'ext', '*.c')))
[2675227]41
42aubio_extension = Extension("aubio._aubio",
43    sources,
[4d3b573]44    include_dirs = include_dirs,
45    library_dirs = library_dirs,
46    extra_link_args = extra_link_args,
[2675227]47    define_macros = define_macros)
48
49if os.path.isfile('src/aubio.h'):
[8d09036]50    if not os.path.isdir(os.path.join('build','src')):
51        __version__ += 'a2' # python only version
[2675227]52
[945e26d]53classifiers = [
[4d3b573]54    'Development Status :: 4 - Beta',
55    'Environment :: Console',
56    'Intended Audience :: Science/Research',
57    'Topic :: Software Development :: Libraries',
58    'Topic :: Multimedia :: Sound/Audio :: Analysis',
59    'Topic :: Multimedia :: Sound/Audio :: Sound Synthesis',
60    'Operating System :: POSIX',
61    'Operating System :: MacOS :: MacOS X',
62    'Operating System :: Microsoft :: Windows',
63    'Programming Language :: C',
64    'Programming Language :: Python',
65    'License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)',
66    ]
[012b324]67
[945e26d]68distrib = setup(name='aubio',
[4d3b573]69    version = __version__,
70    packages = ['aubio'],
[1167631]71    package_dir = {'aubio':'python/lib/aubio'},
72    scripts = ['python/scripts/aubiocut'],
[4d3b573]73    ext_modules = [aubio_extension],
[dc1fbc6]74    description = 'a collection of tools for music analysis',
75    long_description = 'a collection of tools for music analysis',
[4d3b573]76    license = 'GNU/GPL version 3',
77    author = 'Paul Brossier',
78    author_email = 'piem@aubio.org',
79    maintainer = 'Paul Brossier',
80    maintainer_email = 'piem@aubio.org',
81    url = 'http://aubio.org/',
82    platforms = 'any',
83    classifiers = classifiers,
[16f8dcc]84    install_requires = ['numpy'],
[a89ed31]85    cmdclass = {
86        'clean': CleanGenerated,
[b1d37c0]87        'build_ext': build_ext,
[1167631]88        },
89    test_suite = 'nose2.collector.collector',
[4d3b573]90    )
Note: See TracBrowser for help on using the repository browser.