update install

This commit is contained in:
qinzy
2024-02-19 18:23:59 +00:00
parent 10006e9a95
commit 40bc3a5067
3 changed files with 22 additions and 5 deletions

View File

@@ -1,9 +1,24 @@
import os
from setuptools import setup, find_packages
from setuptools.command.develop import develop
from setuptools.command.install import install
cwd = os.path.dirname(os.path.abspath(__file__))
requirements = open(os.path.join(cwd, "requirements.txt"), "r").readlines()
class PostInstallCommand(install):
"""Post-installation for installation mode."""
def run(self):
install.run(self)
os.system('python -m unidic download')
class PostDevelopCommand(develop):
"""Post-installation for development mode."""
def run(self):
develop.run(self)
os.system('python -m unidic download')
setup(
name='MyShellTTSBase',
version='0.1.0',
@@ -13,4 +28,8 @@ setup(
package_data={
'': ['*.txt', 'cmudict_*'],
},
cmdclass={
'develop': PostDevelopCommand,
'install': PostInstallCommand,
},
)