setup.py 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  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.7.0",
  12. "humanfriendly",
  13. "scipy>=1.4.1",
  14. "filelock",
  15. "librosa>=0.8.0",
  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. ],
  39. # train: The modules invoked when training only.
  40. "train": [
  41. "pillow>=6.1.0",
  42. "editdistance==0.5.2",
  43. "wandb",
  44. ],
  45. # recipe: The modules actually are not invoked in the main module of funasr,
  46. # but are invoked for the python scripts in each recipe
  47. "recipe": [
  48. "espnet_model_zoo",
  49. "gdown",
  50. "resampy",
  51. "pysptk>=0.1.17",
  52. "morfessor", # for zeroth-korean
  53. "youtube_dl", # for laborotv
  54. "nnmnkwii",
  55. "museval>=0.2.1",
  56. "pystoi>=0.2.2",
  57. "mir-eval>=0.6",
  58. "fastdtw",
  59. "nara_wpe>=0.0.5",
  60. "sacrebleu>=1.5.1",
  61. ],
  62. # all: The modules should be optionally installled due to some reason.
  63. # Please consider moving them to "install" occasionally
  64. # NOTE(kamo): The modules in "train" and "recipe" are appended into "all"
  65. "all": [
  66. # NOTE(kamo): Append modules requiring specific pytorch version or torch>1.3.0
  67. "torch_optimizer",
  68. "fairscale",
  69. "transformers",
  70. "gtn==0.0.0",
  71. ],
  72. "setup": [
  73. "numpy<=1.21.3",
  74. "pytest-runner",
  75. ],
  76. "test": [
  77. "pytest>=3.3.0",
  78. "pytest-timeouts>=1.2.1",
  79. "pytest-pythonpath>=0.7.3",
  80. "pytest-cov>=2.7.1",
  81. "hacking>=2.0.0",
  82. "mock>=2.0.0",
  83. "pycodestyle",
  84. "jsondiff<2.0.0,>=1.2.0",
  85. "flake8>=3.7.8",
  86. "flake8-docstrings>=1.3.1",
  87. "black",
  88. ],
  89. "doc": [
  90. "Jinja2<3.1",
  91. "Sphinx==2.1.2",
  92. "sphinx-rtd-theme>=0.2.4",
  93. "sphinx-argparse>=0.2.5",
  94. "commonmark==0.8.1",
  95. "recommonmark>=0.4.0",
  96. "nbsphinx>=0.4.2",
  97. "sphinx-markdown-tables>=0.0.12",
  98. ],
  99. }
  100. requirements["all"].extend(requirements["train"] + requirements["recipe"])
  101. requirements["test"].extend(requirements["train"])
  102. install_requires = requirements["install"]
  103. setup_requires = requirements["setup"]
  104. tests_require = requirements["test"]
  105. extras_require = {
  106. k: v for k, v in requirements.items() if k not in ["install", "setup"]
  107. }
  108. dirname = os.path.dirname(__file__)
  109. version_file = os.path.join(dirname, "funasr", "version.txt")
  110. with open(version_file, "r") as f:
  111. version = f.read().strip()
  112. setup(
  113. name="funasr",
  114. version=version,
  115. url="https://github.com/alibaba-damo-academy/FunASR.git",
  116. author="Speech Lab, Alibaba Group, China",
  117. author_email="funasr@list.alibaba-inc.com",
  118. description="FunASR: A Fundamental End-to-End Speech Recognition Toolkit",
  119. long_description=open(os.path.join(dirname, "README.md"), encoding="utf-8").read(),
  120. long_description_content_type="text/markdown",
  121. license="The MIT License",
  122. packages=find_packages(include=["funasr*"]),
  123. package_data={"funasr": ["version.txt"]},
  124. install_requires=install_requires,
  125. setup_requires=setup_requires,
  126. tests_require=tests_require,
  127. extras_require=extras_require,
  128. python_requires=">=3.7.0",
  129. classifiers=[
  130. "Programming Language :: Python",
  131. "Programming Language :: Python :: 3",
  132. "Programming Language :: Python :: 3.7",
  133. "Programming Language :: Python :: 3.8",
  134. "Programming Language :: Python :: 3.9",
  135. "Development Status :: 5 - Production/Stable",
  136. "Intended Audience :: Science/Research",
  137. "Operating System :: POSIX :: Linux",
  138. "License :: OSI Approved :: Apache Software License",
  139. "Topic :: Software Development :: Libraries :: Python Modules",
  140. ],
  141. )