setup.py 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. import os
  2. from functools import reduce
  3. from setuptools import setup, find_packages
  4. here = os.path.abspath(os.path.dirname(__file__))
  5. about = {}
  6. with open(os.path.join(here, 'pywebio', '__version__.py')) as f:
  7. exec(f.read(), about)
  8. with open('README.md') as f:
  9. readme = f.read()
  10. extras_require = {
  11. 'flask': ['flask'],
  12. 'django': ['django'],
  13. 'aiohttp': ['aiohttp'],
  14. 'bokeh': ['bokeh'],
  15. }
  16. # 可以使用 pip install pywebio[all] 安装所有额外依赖
  17. extras_require['all'] = reduce(lambda x, y: x + y, extras_require.values())
  18. setup(
  19. name=about['__package__'],
  20. version=about['__version__'],
  21. description=about['__description__'],
  22. long_description=readme,
  23. long_description_content_type='text/markdown',
  24. author=about['__author__'],
  25. author_email=about['__author_email__'],
  26. url=about['__url__'],
  27. license=about['__license__'],
  28. python_requires=">=3.5.2",
  29. packages=find_packages(),
  30. package_data={
  31. # data files need to be listed both here (which determines what gets
  32. # installed) and in MANIFEST.in (which determines what gets included
  33. # in the sdist tarball)
  34. "pywebio": [
  35. "html/codemirror/base16-light.min.css",
  36. "html/codemirror/active-line.js",
  37. "html/codemirror/matchbrackets.js",
  38. "html/codemirror/loadmode.js",
  39. "html/codemirror/python.js",
  40. "html/css/bootstrap.min.css",
  41. "html/css/mditor.min.css",
  42. "html/css/jquery.toast.min.css",
  43. "html/css/mditor.min.css.map",
  44. "html/css/app.css",
  45. "html/css/codemirror.min.css",
  46. "html/js/FileSaver.min.js",
  47. "html/js/mditor.min.js",
  48. "html/js/.DS_Store",
  49. "html/js/codemirror.js",
  50. "html/js/pywebio.js",
  51. "html/js/mustache.min.js",
  52. "html/js/jquery.min.js",
  53. "html/js/bootstrap.min.js",
  54. "html/js/bs-custom-file-input.min.js",
  55. "html/js/popper.min.js",
  56. "html/js/jquery.toast.min.js",
  57. "html/js/require.min.js",
  58. "html/js/codemirror.min.js",
  59. "html/image/favicon_open_16.png",
  60. "html/image/favicon_closed_32.png",
  61. "html/index_cdn.html",
  62. "html/index.html",
  63. ],
  64. },
  65. classifiers=[
  66. "Programming Language :: Python :: 3",
  67. "Programming Language :: Python :: 3.5",
  68. "Programming Language :: Python :: 3.6",
  69. "Programming Language :: Python :: 3.7",
  70. "Programming Language :: Python :: 3.8",
  71. ],
  72. install_requires=[
  73. 'tornado>=4.3.0', # After this version, the new async/await keywords in Python 3.5 are supported
  74. 'python-user-agents',
  75. ],
  76. extras_require=extras_require,
  77. project_urls={
  78. 'Documentation': 'https://pywebio.readthedocs.io',
  79. 'Source': 'https://github.com/wang0618/PyWebIO',
  80. },
  81. )