setup.py 3.2 KB

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