setup.py 4.4 KB

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