-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathsetup.py
51 lines (43 loc) · 1.56 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
import os
import setuptools
from subprocess import call
from distutils.command.build import build
from setuptools.command.install import install
class CustomBuild(build):
def run(self):
build.run(self)
build_path = os.path.abspath(self.build_temp)
base_path = os.path.dirname(__file__)
c_src_path = os.path.join(base_path, 'c_src')
cmd = ['make', 'OUT={}'.format(build_path), 'lib']
def compile():
call(cmd, cwd=c_src_path)
self.mkpath(self.build_temp)
self.execute(compile, [], 'Building liblyon')
self.mkpath(self.build_lib)
if not self.dry_run:
target = os.path.join(build_path, 'liblyon.so')
self.copy_file(target, os.path.join(self.build_lib, 'lyon'))
with open("README.md", "r") as fh:
long_description = fh.read()
setuptools.setup(
name="lyon",
version="1.0.0",
maintainer="Dmytro Tkanov",
maintainer_email="[email protected]",
license='Apache License 2.0',
description="Python port of Lyon's model from AuditoryToolbox",
long_description=long_description,
long_description_content_type="text/markdown",
url="https://github.com/sciforce/lyon",
packages=setuptools.find_packages(),
include_package_data=True,
install_requires=['numpy'],
classifiers=[
"Programming Language :: Python :: 3",
"License :: OSI Approved :: Apache Software License",
"Operating System :: POSIX :: Linux",
"Topic :: Multimedia :: Sound/Audio",
],
cmdclass={'build': CustomBuild}
)