-
Notifications
You must be signed in to change notification settings - Fork 70
/
Copy pathsetup.py
46 lines (39 loc) · 1.51 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
from setuptools import setup, Extension, find_packages
from setuptools.command.build_ext import build_ext as _build_ext
import os
includes = ['pypesq']
try:
import numpy as np
includes += [os.path.join(np.get_include(), 'numpy')]
except:
pass
extension = Extension("pesq_core",
sources=["pypesq/pesq.c", "pypesq/dsp.c", "pypesq/pesqdsp.c",
"pypesq/pesqio.c", "pypesq/pesqmain.c", "pypesq/pesqmod.c"],
include_dirs=includes,
language='c')
class build_ext(_build_ext):
def finalize_options(self):
_build_ext.finalize_options(self)
try:
__builtins__.__NUMPY_SETUP__ = False
except AttributeError:
print("Cannot set '__builtins__.__NUMPY_SETUP__ = False' This is not needed if numpy is already installed.")
import numpy
self.include_dirs.append(numpy.get_include())
setup(name='pypesq',
version='1.2.4',
description="A package to compute pesq score.",
url='https://github.com/vBaiCai/python-pesq',
author_email='[email protected]',
keywords=['pesq', 'speech', 'speech quality'],
license='MIT',
packages=find_packages(),
ext_modules=[extension],
cmdclass={'build_ext': build_ext},
setup_requires=['numpy'],
py_modules=['numpy'],
zip_safe=False,
install_requires=['numpy'],
python_requires='!=3.0.*, !=3.1.*, !=3.2.*, <4',
)