setup.py 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. #!/usr/bin/env python3
  2. """FunASR setup script."""
  3. import os
  4. from setuptools import find_packages
  5. from setuptools import setup
  6. requirements = {
  7. "install": [
  8. "setuptools>=38.5.1",
  9. "humanfriendly",
  10. "scipy>=1.4.1",
  11. "librosa",
  12. "jamo", # For kss
  13. "PyYAML>=5.1.2",
  14. "soundfile>=0.12.1",
  15. "h5py>=3.1.0",
  16. "kaldiio>=2.17.0",
  17. "torch_complex",
  18. "nltk>=3.4.5",
  19. # ASR
  20. "sentencepiece",
  21. "jieba",
  22. "rotary_embedding_torch",
  23. # TTS
  24. "pypinyin>=0.44.0",
  25. "espnet_tts_frontend",
  26. # ENH
  27. "pytorch_wpe",
  28. "editdistance>=0.5.2",
  29. "tensorboard",
  30. "g2p",
  31. "nara_wpe",
  32. # PAI
  33. "oss2",
  34. "edit-distance",
  35. "textgrid",
  36. "protobuf",
  37. "tqdm",
  38. ],
  39. # train: The modules invoked when training only.
  40. "train": [
  41. "editdistance",
  42. "wandb",
  43. ],
  44. # all: The modules should be optionally installled due to some reason.
  45. # Please consider moving them to "install" occasionally
  46. "all": [
  47. # NOTE(kamo): Append modules requiring specific pytorch version or torch>1.3.0
  48. "torch_optimizer",
  49. "fairscale",
  50. "transformers",
  51. ],
  52. "setup": [
  53. "numpy",
  54. "pytest-runner",
  55. ],
  56. "test": [
  57. "pytest>=3.3.0",
  58. "pytest-timeouts>=1.2.1",
  59. "pytest-pythonpath>=0.7.3",
  60. "pytest-cov>=2.7.1",
  61. "hacking>=2.0.0",
  62. "mock>=2.0.0",
  63. "pycodestyle",
  64. "jsondiff<2.0.0,>=1.2.0",
  65. "flake8>=3.7.8",
  66. "flake8-docstrings>=1.3.1",
  67. "black",
  68. ],
  69. "doc": [
  70. "Jinja2",
  71. "Sphinx",
  72. "sphinx-rtd-theme>=0.2.4",
  73. "sphinx-argparse>=0.2.5",
  74. "commonmark",
  75. "recommonmark>=0.4.0",
  76. "nbsphinx>=0.4.2",
  77. "sphinx-markdown-tables>=0.0.12",
  78. "configargparse>=1.2.1"
  79. ],
  80. }
  81. requirements["all"].extend(requirements["train"])
  82. requirements["test"].extend(requirements["train"])
  83. install_requires = requirements["install"]
  84. setup_requires = requirements["setup"]
  85. tests_require = requirements["test"]
  86. extras_require = {
  87. k: v for k, v in requirements.items() if k not in ["install", "setup"]
  88. }
  89. dirname = os.path.dirname(__file__)
  90. version_file = os.path.join(dirname, "funasr", "version.txt")
  91. with open(version_file, "r") as f:
  92. version = f.read().strip()
  93. setup(
  94. name="funasr",
  95. version=version,
  96. url="https://github.com/alibaba-damo-academy/FunASR.git",
  97. author="Speech Lab of DAMO Academy, Alibaba Group",
  98. author_email="funasr@list.alibaba-inc.com",
  99. description="FunASR: A Fundamental End-to-End Speech Recognition Toolkit",
  100. long_description=open(os.path.join(dirname, "README.md"), encoding="utf-8").read(),
  101. long_description_content_type="text/markdown",
  102. license="The MIT License",
  103. packages=find_packages(include=["funasr*"]),
  104. package_data={"funasr": ["version.txt"]},
  105. install_requires=install_requires,
  106. setup_requires=setup_requires,
  107. tests_require=tests_require,
  108. extras_require=extras_require,
  109. python_requires=">=3.7.0",
  110. classifiers=[
  111. "Programming Language :: Python",
  112. "Programming Language :: Python :: 3",
  113. "Programming Language :: Python :: 3.7",
  114. "Programming Language :: Python :: 3.8",
  115. "Programming Language :: Python :: 3.9",
  116. "Development Status :: 5 - Production/Stable",
  117. "Intended Audience :: Science/Research",
  118. "Operating System :: POSIX :: Linux",
  119. "License :: OSI Approved :: Apache Software License",
  120. "Topic :: Software Development :: Libraries :: Python Modules",
  121. ],
  122. )