forked from JeremyCCHsu/Python-Wrapper-for-World-Vocoder
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
85 lines (74 loc) · 2.45 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
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
from __future__ import with_statement, print_function, absolute_import
from setuptools import setup, find_packages, Extension
from distutils.version import LooseVersion
# import numpy as np
import os
from glob import glob
from os.path import join
from setuptools.command.build_ext import build_ext as _build_ext
class build_ext(_build_ext):
def finalize_options(self):
_build_ext.finalize_options(self)
# Prevent numpy from thinking it is still in its setup process:
__builtins__.__NUMPY_SETUP__ = False
import numpy
self.include_dirs.append(numpy.get_include())
# # This can be loosen probably, though it's fine I think
# min_cython_ver = '0.24.0'
# try:
# import Cython
# ver = Cython.__version__
# _CYTHON_INSTALLED = ver >= LooseVersion(min_cython_ver)
# except ImportError:
# _CYTHON_INSTALLED = False
# try:
# if not _CYTHON_INSTALLED:
# raise ImportError('No supported version of Cython installed.')
# from Cython.Distutils import build_ext
# cython = True
# except ImportError:
# cython = False
# if cython:
# ext = '.pyx'
# cmdclass = {'build_ext': build_ext}
# else:
# ext = '.cpp'
# cmdclass = {}
# if not os.path.exists(join("pyworld", "pyworld" + ext)):
# raise RuntimeError("Cython is required to generate C++ wrapper")
world_src_top = join("lib", "World", "src")
world_sources = glob(join(world_src_top, "*.cpp"))
ext_modules = [
Extension(
name="pyworld.pyworld",
# include_dirs=[np.get_include(), world_src_top],
include_dirs=[world_src_top],
sources=[join("pyworld", "pyworld.pyx")] + world_sources,
language="c++")]
setup(
name="pyworld",
ext_modules=ext_modules,
# cmdclass=cmdclass,
cmdclass={'build_ext':build_ext},
version='0.2.2.dev1',
packages=find_packages(),
setup_requires=[
'numpy',
# 'cython>=0.24.0',
],
install_requires=[
'numpy',
'cython>=0.24.0',
],
extras_require={
'test': ['nose'],
# 'develop': ['cython >= ' + min_cython_ver],
'sdist': ['numpy', 'cython'],
},
author="Pyworld Contributors",
author_email="[email protected]",
url="https://github.com/JeremyCCHsu/Python-Wrapper-for-World-Vocoder",
description="a Python wrapper for the WORLD vocoder",
keywords=['vocoder'],
classifiers=[],
)