setup.py 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  1. #!/usr/bin/env python3
  2. """FunASR setup script."""
  3. import os
  4. from distutils.version import LooseVersion
  5. from setuptools import find_packages
  6. from setuptools import setup
  7. requirements = {
  8. "install": [
  9. "setuptools>=38.5.1",
  10. # "configargparse>=1.2.1",
  11. "typeguard==2.13.3",
  12. "humanfriendly",
  13. "scipy>=1.4.1",
  14. # "filelock",
  15. "librosa==0.8.1",
  16. "jamo==0.4.1", # For kss
  17. "PyYAML>=5.1.2",
  18. "soundfile>=0.10.2",
  19. "h5py>=2.10.0",
  20. "kaldiio>=2.17.0",
  21. "torch_complex",
  22. "nltk>=3.4.5",
  23. # ASR
  24. "sentencepiece",
  25. # "ctc-segmentation<1.8,>=1.6.6",
  26. # TTS
  27. # "pyworld>=0.2.10",
  28. "pypinyin<=0.44.0",
  29. "espnet_tts_frontend",
  30. # ENH
  31. # "ci_sdr",
  32. "pytorch_wpe",
  33. "editdistance==0.5.2",
  34. "tensorboard==1.15",
  35. "g2p",
  36. # PAI
  37. "oss2",
  38. # "kaldi-native-fbank",
  39. # timestamp
  40. "edit-distance",
  41. # textgrid
  42. "textgrid",
  43. "protobuf==3.20.0",
  44. ],
  45. # train: The modules invoked when training only.
  46. "train": [
  47. # "pillow>=6.1.0",
  48. "editdistance==0.5.2",
  49. "wandb",
  50. ],
  51. # recipe: The modules actually are not invoked in the main module of funasr,
  52. # but are invoked for the python scripts in each recipe
  53. "recipe": [
  54. "espnet_model_zoo",
  55. # "gdown",
  56. # "resampy",
  57. # "pysptk>=0.1.17",
  58. # "morfessor", # for zeroth-korean
  59. # "youtube_dl", # for laborotv
  60. # "nnmnkwii",
  61. # "museval>=0.2.1",
  62. # "pystoi>=0.2.2",
  63. # "mir-eval>=0.6",
  64. # "fastdtw",
  65. # "nara_wpe>=0.0.5",
  66. # "sacrebleu>=1.5.1",
  67. ],
  68. # all: The modules should be optionally installled due to some reason.
  69. # Please consider moving them to "install" occasionally
  70. # NOTE(kamo): The modules in "train" and "recipe" are appended into "all"
  71. "all": [
  72. # NOTE(kamo): Append modules requiring specific pytorch version or torch>1.3.0
  73. "torch_optimizer",
  74. "fairscale",
  75. "transformers",
  76. # "gtn==0.0.0",
  77. ],
  78. "setup": [
  79. "numpy<=1.21.3",
  80. "pytest-runner",
  81. ],
  82. "test": [
  83. "pytest>=3.3.0",
  84. "pytest-timeouts>=1.2.1",
  85. "pytest-pythonpath>=0.7.3",
  86. "pytest-cov>=2.7.1",
  87. "hacking>=2.0.0",
  88. "mock>=2.0.0",
  89. "pycodestyle",
  90. "jsondiff<2.0.0,>=1.2.0",
  91. "flake8>=3.7.8",
  92. "flake8-docstrings>=1.3.1",
  93. "black",
  94. ],
  95. "doc": [
  96. "Jinja2<3.1",
  97. "Sphinx==2.1.2",
  98. "sphinx-rtd-theme>=0.2.4",
  99. "sphinx-argparse>=0.2.5",
  100. "commonmark==0.8.1",
  101. "recommonmark>=0.4.0",
  102. "nbsphinx>=0.4.2",
  103. "sphinx-markdown-tables>=0.0.12",
  104. ],
  105. }
  106. requirements["all"].extend(requirements["train"] + requirements["recipe"])
  107. requirements["test"].extend(requirements["train"])
  108. install_requires = requirements["install"]
  109. setup_requires = requirements["setup"]
  110. tests_require = requirements["test"]
  111. extras_require = {
  112. k: v for k, v in requirements.items() if k not in ["install", "setup"]
  113. }
  114. dirname = os.path.dirname(__file__)
  115. version_file = os.path.join(dirname, "funasr", "version.txt")
  116. with open(version_file, "r") as f:
  117. version = f.read().strip()
  118. setup(
  119. name="funasr",
  120. version=version,
  121. url="https://github.com/alibaba-damo-academy/FunASR.git",
  122. author="Speech Lab of DAMO Academy, Alibaba Group",
  123. author_email="funasr@list.alibaba-inc.com",
  124. description="FunASR: A Fundamental End-to-End Speech Recognition Toolkit",
  125. long_description=open(os.path.join(dirname, "README.md"), encoding="utf-8").read(),
  126. long_description_content_type="text/markdown",
  127. license="The MIT License",
  128. packages=find_packages(include=["funasr*"]),
  129. package_data={"funasr": ["version.txt"]},
  130. install_requires=install_requires,
  131. setup_requires=setup_requires,
  132. tests_require=tests_require,
  133. extras_require=extras_require,
  134. python_requires=">=3.7.0",
  135. classifiers=[
  136. "Programming Language :: Python",
  137. "Programming Language :: Python :: 3",
  138. "Programming Language :: Python :: 3.7",
  139. "Programming Language :: Python :: 3.8",
  140. "Programming Language :: Python :: 3.9",
  141. "Development Status :: 5 - Production/Stable",
  142. "Intended Audience :: Science/Research",
  143. "Operating System :: POSIX :: Linux",
  144. "License :: OSI Approved :: Apache Software License",
  145. "Topic :: Software Development :: Libraries :: Python Modules",
  146. ],
  147. )