
#############################################
# File Name: setup.py
# Author: Acloudtwei
# Mail: acloudtwei@gmail.com
# Created Time:  2022-02-15 11:58
#############################################
import os
from functools import reduce

from setuptools import setup

here = os.path.abspath(os.path.dirname(__file__))

about = {}
with open(os.path.join(here, 'weipyweb', '__version__.py'), encoding='utf8') as f:
    exec(f.read(), about)

with open('README.md', encoding='utf8') as f:
    readme = f.read()
    
extras_require = {
    'flask': ['flask>=0.10'],
    'django': ['django>=2.2'],
    'aiohttp': ['aiohttp>=3.1'],
    'bokeh': ['bokeh'],
    'doc': ['sphinx', 'sphinx-tabs'],
}
# 可以使用 pip install weipyweb[all] 安装所有额外依赖
extras_require['all'] = reduce(lambda x, y: x + y, extras_require.values())

setup(
    name=about['__package__'],
    version=about['__version__'],
    description=about['__description__'],
    long_description=readme,
    long_description_content_type='text/markdown',
    author=about['__author__'],
    author_email=about['__author_email__'],
    url=about['__url__'],
    license=about['__license__'],
    python_requires=">=3.5.2",
    packages=['weipyweb', 'weipyweb.session', 'weipyweb.platform'],
    scripts=['tools/weipyweb-path-deploy'],
    package_data={
        #数据文件需要在这里列出(这决定了
        # installed)和MANIFEST.in(确定包含的内容
        #在目录中)
        "weipyweb": [
            "html/codemirror/active-line.js",
            "html/codemirror/matchbrackets.js",
            "html/codemirror/loadmode.js",
            "html/codemirror/autorefresh.js",
            "html/codemirror/addons.js",
            "html/codemirror/python.js",
            "html/css/markdown.min.css",
            "html/css/toastify.min.css",
            "html/css/app.css",
            "html/css/codemirror.min.css",
            "html/css/bootstrap-select.min.css",
            "html/css/bs-theme/default.min.css",
            "html/css/bs-theme/minty.min.css",
            "html/css/bs-theme/yeti.min.css",
            "html/css/bs-theme/dark.min.css",
            "html/css/bs-theme/sketchy.min.css",
            "html/js/FileSaver.min.js",
            "html/js/prism.min.js",
            "html/js/purify.min.js",
            "html/js/weipyweb.min.js",
            "html/js/weipyweb.min.js.map",  # only available in dev version
            "html/js/mustache.min.js",
            "html/js/jquery.min.js",
            "html/js/bootstrap.min.js",
            "html/js/bs-custom-file-input.min.js",
            "html/js/popper.min.js",
            "html/js/toastify.min.js",
            "html/js/require.min.js",
            "html/js/codemirror.min.js",
            "html/js/bootstrap-select.min.js",
            "html/image/favicon_open_16.png",
            "html/image/favicon_closed_32.png",
            "platform/tpl/index.html"
        ],
    },
    classifiers=[
        "Programming Language :: Python :: 3",
        "Programming Language :: Python :: 3.5",
        "Programming Language :: Python :: 3.6",
        "Programming Language :: Python :: 3.7",
        "Programming Language :: Python :: 3.8",
    ],
    install_requires=[
        'tornado>=5.0',
        'user-agents',
    ],
    extras_require=extras_require,
    project_urls={
        'Documentation': 'https://pywebio.readthedocs.io'
    },
)
