-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathsetup.py
57 lines (49 loc) · 1.46 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
from setuptools import setup, find_packages, Extension
from setuptools.command.build_ext import build_ext
import numpy
try:
from Cython.Build import cythonize
USE_CYTHON = True
except ImportError:
USE_CYTHON = False
# https://cython.readthedocs.io/en/latest/src/userguide/source_files_and_compilation.html
ext = '.pyx' if USE_CYTHON else '.c'
extensions = [
Extension(
name="alqalign.ctc_segmentation.ctc_segmentation_dyn",
sources=["alqalign/ctc_segmentation/ctc_segmentation_dyn"+ext],
include_dirs=[numpy.get_include()],
)
]
if USE_CYTHON:
from Cython.Build import cythonize
extensions = cythonize(extensions)
def get_requirements():
"""
Return requirements as list.
package1==1.0.3
package2==0.0.5
"""
with open('requirements.txt') as f:
packages = []
for line in f:
line = line.strip()
# let's also ignore empty lines and comments
if not line or line.startswith('#'):
continue
packages.append(line)
return packages
setup(
name='alqalign',
version='1.3.0',
description='a text-speech alignment model',
author='Xinjian Li',
author_email='[email protected]',
packages=find_packages(exclude=["tests"]),
setup_requires=["numpy"],
url="https://github.com/xinjli/alignspeech",
install_requires=get_requirements(),
zip_safe=False,
ext_modules=extensions,
cmdclass={'build_ext': build_ext},
)