-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.py
More file actions
90 lines (68 loc) · 3 KB
/
setup.py
File metadata and controls
90 lines (68 loc) · 3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
from os import path
from codecs import open # To use a consistent encoding
import json
from setuptools import setup, find_packages, Extension
from Cython.Build import cythonize
import numpy as np
import pkgconfig
here = path.abspath(path.dirname(__file__))
# Get the long description from the README file
with open(path.join(here, 'README.md'), encoding='utf-8') as f:
long_description = f.read()
with open(path.join(here, 'tunescope/data/config.json')) as f:
config = json.load(f)
audiobackend_compiler_args = pkgconfig.parse('gstreamer-1.0 gstreamer-app-1.0 gstreamer-audio-1.0')
audiodecoder_compiler_args = pkgconfig.parse('gstreamer-1.0 gstreamer-app-1.0 gstreamer-audio-1.0')
audiodecoder_compiler_args['include_dirs'].append(np.get_include())
audiometadata_compiler_args = pkgconfig.parse('gstreamer-1.0 gstreamer-pbutils-1.0')
audiooutput_compiler_args = pkgconfig.parse('sdl2')
audiooutput_compiler_args['include_dirs'].append(np.get_include())
extensions = [
Extension('tunescope.audio.audiobackend',
['tunescope/audio/audiobackend.pyx'],
**audiobackend_compiler_args),
Extension('tunescope.audio.audiodecoder',
['tunescope/audio/audiodecoder.pyx'],
**audiodecoder_compiler_args),
Extension('tunescope.audio.audiometadata',
['tunescope/audio/audiometadata.pyx'],
**audiometadata_compiler_args),
Extension('tunescope.audio.audiooutput',
['tunescope/audio/audiooutput.pyx'],
**audiooutput_compiler_args),
Extension('tunescope.audio.audioutil',
['tunescope/audio/audioutil.pyx'],
include_dirs=[np.get_include()]),
Extension('tunescope.audio.buffering',
['tunescope/audio/buffering.pyx'],
include_dirs=[np.get_include()]),
Extension('tunescope.audio.looper',
['tunescope/audio/looper.pyx'],
include_dirs=[np.get_include()]),
Extension('tunescope.audio.timestretcher',
['tunescope/audio/timestretcher.pyx'],
libraries=['rubberband'],
include_dirs=[np.get_include(), 'lib/rubberband'],
library_dirs=['lib/rubberband/lib']),
Extension('tunescope.visualization.processing',
['tunescope/visualization/processing.pyx'],
include_dirs=[np.get_include()]),
]
setup(
name='TuneScope',
version=config['version'],
description='An application for tune learning',
long_description=long_description,
url='https://github.com/brsaylor/TuneScope',
author='Ben Saylor',
author_email='brsaylor@gmail.com',
license='GNU General Public License v3 or later (GPLv3+)',
classifiers=[
'Development Status :: 3 - Alpha',
'Intended Audience :: Science/Research',
'License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)',
'Programming Language :: Python :: 2.7',
],
packages=find_packages(),
ext_modules=cythonize(extensions, build_dir='build'),
)