forked from Kitt-AI/snowboy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
60 lines (50 loc) · 1.78 KB
/
setup.py
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
import os
from sys import platform
from setuptools import setup, find_packages
from setuptools.command.install import install
from distutils.command.build import build
from subprocess import call
from multiprocessing import cpu_count
class SnowboyBuild(build):
def run(self):
cmd = ['make']
def compile():
call(cmd, cwd='swig/Python')
self.execute(compile, [], 'Compiling snowboy')
# copy generated .so to build folder
self.mkpath(self.build_lib)
self.mkpath(os.path.join(self.build_lib, 'snowboy'))
target_file = 'swig/Python/_snowboydetect.so'
if not self.dry_run:
self.copy_file(target_file,
os.path.join(self.build_lib, 'snowboy'))
build.run(self)
setup(
name='snowboy',
version='1.2.0',
description='Snowboy is a customizable hotword detection engine',
maintainer='KITT.AI',
maintainer_email='[email protected]',
license='Apache-2.0',
url='https://snowboy.kitt.ai',
packages=find_packages('examples/Python/'),
package_dir={'snowboy': 'examples/Python/'},
py_modules=['snowboy.snowboydecoder', 'snowboy.snowboydetect'],
package_data={'': ['README.md', 'snowboy/resources/common.res']},
data_files=[('.', ['README.md']),
('snowboy/resources', ['resources/common.res',
'resources/ding.wav',
'resources/dong.wav',
'resources/snowboy.wav',
'resources/snowboy.umdl'])],
include_package_data=True,
zip_safe=False,
long_description="",
classifiers=[],
install_requires=[
'PyAudio',
],
cmdclass={
'build': SnowboyBuild
}
)