setup.py 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  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'), 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=[p for p in find_packages() if p.startswith('pywebio')],
  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/*",
  38. "html/image/*",
  39. "html/js/*",
  40. "html/css/*",
  41. "html/css/bs-theme/*",
  42. "platform/tpl/index.html"
  43. ],
  44. },
  45. entry_points={
  46. # pyinstaller hook
  47. # https://pyinstaller.org/en/stable/hooks.html#providing-pyinstaller-hooks-with-your-package
  48. 'pyinstaller40': [
  49. 'hook-dirs = pywebio.platform.pyinstaller:get_hook_dirs',
  50. ]
  51. },
  52. classifiers=[
  53. "Programming Language :: Python :: 3",
  54. "Programming Language :: Python :: 3.5",
  55. "Programming Language :: Python :: 3.6",
  56. "Programming Language :: Python :: 3.7",
  57. "Programming Language :: Python :: 3.8",
  58. ],
  59. install_requires=[
  60. 'tornado>=5.0',
  61. 'user-agents',
  62. ],
  63. extras_require=extras_require,
  64. project_urls={
  65. 'Documentation': 'https://pywebio.readthedocs.io',
  66. 'Source': 'https://github.com/wang0618/PyWebIO',
  67. },
  68. )