-
Notifications
You must be signed in to change notification settings - Fork 74
/
setup.py
51 lines (46 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
47
48
49
50
51
import platform
from pathlib import Path
# Available at setup time due to pyproject.toml
from pybind11.setup_helpers import Pybind11Extension, build_ext
from setuptools import setup
_DIR = Path(__file__).parent
_ESPEAK_DIR = _DIR / "espeak-ng" / "build"
_LIB_DIR = _DIR / "lib" / f"Linux-{platform.machine()}"
_ONNXRUNTIME_DIR = _LIB_DIR / "onnxruntime"
__version__ = "1.2.0"
ext_modules = [
Pybind11Extension(
"piper_phonemize_cpp",
[
"src/python.cpp",
"src/phonemize.cpp",
"src/phoneme_ids.cpp",
"src/tashkeel.cpp",
],
define_macros=[("VERSION_INFO", __version__)],
include_dirs=[str(_ESPEAK_DIR / "include"), str(_ONNXRUNTIME_DIR / "include")],
library_dirs=[str(_ESPEAK_DIR / "lib"), str(_ONNXRUNTIME_DIR / "lib")],
libraries=["espeak-ng", "onnxruntime"],
),
]
setup(
name="piper_phonemize",
version=__version__,
author="Michael Hansen",
author_email="[email protected]",
url="https://github.com/rhasspy/piper-phonemize",
description="Phonemization libary used by Piper text to speech system",
long_description="",
packages=["piper_phonemize"],
package_data={
"piper_phonemize": [
str(p) for p in (_DIR / "piper_phonemize" / "espeak-ng-data").rglob("*")
]
+ [str(_DIR / "libtashkeel_model.ort")]
},
include_package_data=True,
ext_modules=ext_modules,
cmdclass={"build_ext": build_ext},
zip_safe=False,
python_requires=">=3.7",
)