-
Notifications
You must be signed in to change notification settings - Fork 62
/
Copy pathsetup.py.in
72 lines (57 loc) · 2.18 KB
/
setup.py.in
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
"""Setup script for voice2json"""
import os
from pathlib import Path
import setuptools
this_dir = Path(__file__).parent
# -----------------------------------------------------------------------------
# Load README in as long description
long_description: str = ""
readme_path = this_dir / "README.md"
if readme_path.is_file():
long_description = readme_path.read_text()
# -----------------------------------------------------------------------------
def is_yes(s):
"""True if string is yes (from configure.ac)"""
return s.lower().strip() == "yes"
# -----------------------------------------------------------------------------
requirements_path = this_dir / "requirements.txt"
with open(requirements_path, "r") as requirements_file:
requirements = requirements_file.read().splitlines()
enable_pocketsphinx = is_yes("@ENABLE_POCKETSPHINX@")
if not enable_pocketsphinx:
# Disable pocketsphinx
requirements = [
r for r in requirements if not r.startswith("rhasspy-asr-pocketsphinx")
]
enable_kaldi = is_yes("@ENABLE_KALDI@")
if not enable_kaldi:
# Disable Kaldi
requirements = [
r for r in requirements if not r.startswith("rhasspy-asr-kaldi")
]
enable_deepspeech = is_yes("@ENABLE_DEEPSPEECH@")
if not enable_deepspeech:
# Disable Mozilla's DeepSpeech
requirements = [
r for r in requirements if not r.startswith("rhasspy-asr-deepspeech")
]
# -----------------------------------------------------------------------------
setuptools.setup(
name="@PACKAGE_NAME@",
version="@PACKAGE_VERSION@",
author="Michael Hansen",
author_email="@PACKAGE_BUGREPORT@",
url="https://voice2json.org",
packages=setuptools.find_packages(),
package_data={"@PACKAGE_NAME@": ["py.typed"]},
install_requires=requirements,
classifiers=[
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"License :: OSI Approved :: MIT License",
],
long_description=long_description,
long_description_content_type="text/markdown",
python_requires=">=3.7",
)