-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathsetup.py
88 lines (75 loc) · 2.7 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
86
87
88
from __future__ import unicode_literals
import sys
import platform
import os
import stat
from pyvosklivesubtitle import VERSION
import warnings
warnings.filterwarnings("ignore", category=DeprecationWarning, module='setuptools')
warnings.filterwarnings("ignore", category=UserWarning, module='setuptools')
warnings.filterwarnings("ignore", message=".*is deprecated*")
try:
from setuptools import setup, find_packages
from setuptools.dist import Distribution
except ImportError:
from distutils.core import setup
from distutils.dist import Distribut
if sys.version_info <= (3, 8):
print("THIS MODULE REQUIRES PYTHON 3.8+. YOU ARE CURRENTLY USING PYTHON {0}".format(sys.version))
sys.exit(1)
class BinaryDistribution(Distribution):
def has_ext_modules(self):
return True
def is_pure(self):
return False
def get_ext_modules(self):
if platform.system() == 'Windows':
return []
else:
return super().get_ext_modules()
def get_lib_files():
if platform.system() == 'Linux':
return ['libvosk.so']
elif platform.system() == 'Darwin':
return ['libvosk.dyld']
elif platform.system() == 'Windows':
return ['libgcc_s_seh-1.dll', 'libstdc++-6.dll', 'libvosk.dll', 'libwinpthread-1.dll']
if not (platform.system() == 'Linux' or platform.system() == 'Darwin' or platform.system() == 'Windows'):
raise NotImplementedError(f"Platform '{platform.system()}' is not supported.")
long_description = (
'pyvosklivesubtitle is a python based desktop aplication which can recognize any live streaming'
'in 21 languages that supported by VOSK then translate and display it as LIVE SUBTITLES'
)
install_requires = [
"pysimplegui>=4.60.1",
"sounddevice>=0.4.4",
"vosk>=0.3.44",
"requests>=2.27.1",
"httpx>=0.13.3",
"streamlink>=5.3.1",
"urllib3>=1.26.0,<3.0",
"six>=1.16.0",
"pysrt>=1.1.2",
"tqdm>=4.64.0",
]
if platform.system() == "Windows":
install_requires.append("pywin32>=306")
setup(
name="pyvosklivesubtitle",
description="A Python based desktop aplication that can RECOGNIZE any live streaming in 21 languages that supported by VOSK then TRANSLATE and display it as LIVE SUBTITLES",
version=VERSION,
author='Bot Bahlul',
author_email='bot.bahlul@gmail.com',
url='https://github.com/botbahlul/pyvosklivesubtitle',
packages=[str('pyvosklivesubtitle')],
entry_points={
'console_scripts': [
'pyvosklivesubtitle = pyvosklivesubtitle:main',
],
},
install_requires=install_requires,
license=open("LICENSE").read(),
include_package_data=True,
package_data={'': get_lib_files()},
distclass=BinaryDistribution,
)