source: setup.py @ 89c44aa

feature/autosinkfeature/cnnfeature/cnn_orgfeature/constantqfeature/crepefeature/crepe_orgfeature/pitchshiftfeature/pydocstringsfeature/timestretchfix/ffmpeg5
Last change on this file since 89c44aa was e6a07fe, checked in by Paul Brossier <piem@piem.org>, 6 years ago

[pip] use python/README.md for package long description

  • Property mode set to 100755
File size: 3.0 KB
Line 
1#! /usr/bin/env python
2
3import sys
4import os.path
5import glob
6from setuptools import setup, Extension
7
8# add ./python/lib to current path
9sys.path.append(os.path.join('python', 'lib'))  # noqa
10from moresetuptools import build_ext, CleanGenerated
11
12# function to generate gen/*.{c,h}
13from this_version import get_aubio_version, get_aubio_pyversion
14
15__version__ = get_aubio_pyversion()
16__aubio_version__ = get_aubio_version()
17
18include_dirs = []
19library_dirs = []
20define_macros = [('AUBIO_VERSION', '%s' % __aubio_version__)]
21extra_link_args = []
22
23include_dirs += ['python/ext']
24try:
25    import numpy
26    include_dirs += [numpy.get_include()]
27except ImportError:
28    pass
29
30if sys.platform.startswith('darwin'):
31    extra_link_args += ['-framework', 'CoreFoundation',
32            '-framework', 'AudioToolbox']
33
34sources = sorted(glob.glob(os.path.join('python', 'ext', '*.c')))
35
36aubio_extension = Extension("aubio._aubio",
37    sources,
38    include_dirs = include_dirs,
39    library_dirs = library_dirs,
40    extra_link_args = extra_link_args,
41    define_macros = define_macros)
42
43# TODO: find a way to track if package is built against libaubio
44# if os.path.isfile('src/aubio.h'):
45#     if not os.path.isdir(os.path.join('build','src')):
46#         pass
47#         #__version__ += 'a2' # python only version
48
49classifiers = [
50    'Development Status :: 4 - Beta',
51    'Environment :: Console',
52    'Intended Audience :: Science/Research',
53    'Topic :: Software Development :: Libraries',
54    'Topic :: Multimedia :: Sound/Audio :: Analysis',
55    'Topic :: Multimedia :: Sound/Audio :: Sound Synthesis',
56    'Operating System :: POSIX',
57    'Operating System :: MacOS :: MacOS X',
58    'Operating System :: Microsoft :: Windows',
59    'Programming Language :: C',
60    'Programming Language :: Python',
61    'License :: OSI Approved :: '
62    'GNU General Public License v3 or later (GPLv3+)',
63    ]
64
65thisdir = os.path.abspath(os.path.dirname(__file__))
66py_readme_file = os.path.join(thisdir, 'python', 'README.md')
67with open(py_readme_file, 'r') as fp:
68    long_description = ''.join(fp.readlines()[3:])
69
70distrib = setup(name='aubio',
71    version = __version__,
72    packages = ['aubio'],
73    package_dir = {'aubio': 'python/lib/aubio'},
74    ext_modules = [aubio_extension],
75    description = 'a collection of tools for music analysis',
76    long_description = long_description,
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 = 'https://aubio.org/',
83    platforms = 'any',
84    classifiers = classifiers,
85    install_requires = ['numpy'],
86    setup_requires = ['numpy'],
87    cmdclass = {
88        'clean': CleanGenerated,
89        'build_ext': build_ext,
90        },
91    entry_points = {
92        'console_scripts': [
93            'aubio = aubio.cmd:main',
94            'aubiocut = aubio.cut:main',
95        ],
96    },
97    test_suite = 'nose2.collector.collector',
98    extras_require = {
99        'tests': ['numpy'],
100        },
101    )
Note: See TracBrowser for help on using the repository browser.