forked from DigitOtter/coqui-tts-server-gui
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
29 lines (21 loc) · 854 Bytes
/
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
from setuptools import setup, find_packages
import setuptools
from setuptools.command.build_py import build_py
import os
import subprocess
pkg_name = 'coqui_tts_server_gui'
cwd = os.path.dirname(os.path.abspath(__file__))
# Read requirements
requirements = open(os.path.join(cwd, "requirements.txt"), "r").readlines()
# Create pyqt files
class PyQtBuildPy(build_py):
def run(self):
main_window_ui = os.path.join(cwd, 'forms/main_window.ui')
main_window_ui_py = os.path.join(self.build_lib, pkg_name, 'gui/main_window_ui.py')
os.makedirs(os.path.dirname(main_window_ui_py), exist_ok=True)
subprocess.call([os.sys.executable, '-m', 'PyQt6.uic.pyuic', '-o', main_window_ui_py, '-x', main_window_ui])
build_py.run(self)
setup(
install_requires=requirements,
cmdclass={'build_py': PyQtBuildPy}
)