setup.py 3.6 KB

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