setup.py 3.5 KB

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