1import sys
2
3from setuptools import setup
4import pkg_resources
5
6VERSION = "0.41.0"
7NAME = "websocket_client"
8
9install_requires = ["six"]
10tests_require = []
11
12if sys.version_info[0] == 2 and sys.version_info[1] < 7:
13        tests_require.append('unittest2==0.8.0')
14
15insecure_pythons = '2.4, 2.5, 2.6' + ', '.join("2.7.{pv}".format(pv=pv) for pv in range(10))
16
17extras_require = {
18    ':python_version in "{ips}"'.format(ips=insecure_pythons):
19        ['backports.ssl_match_hostname'],
20    ':python_version in "2.4, 2.5, 2.6"': ['argparse'],
21}
22
23try:
24    if 'bdist_wheel' not in sys.argv:
25        for key, value in extras_require.items():
26            if key.startswith(':') and pkg_resources.evaluate_marker(key[1:]):
27                install_requires.extend(value)
28except Exception:
29    import logging
30    logging.getLogger(__name__).exception(
31        'Something went wrong calculating platform specific dependencies, so '
32        "you're getting them all!"
33    )
34    for key, value in extras_require.items():
35        if key.startswith(':'):
36            install_requires.extend(value)
37
38setup(
39    name=NAME,
40    version=VERSION,
41    description="WebSocket client for python. hybi13 is supported.",
42    long_description=open("README.rst").read(),
43    author="liris",
44    author_email="liris.pp@gmail.com",
45    license="LGPL",
46    url="https://github.com/websocket-client/websocket-client.git",
47    classifiers=[
48        "Development Status :: 4 - Beta",
49        "License :: OSI Approved :: GNU Library or Lesser General Public License (LGPL)",
50        "Programming Language :: Python",
51        "Programming Language :: Python :: 2",
52        "Programming Language :: Python :: 3",
53        "Operating System :: MacOS :: MacOS X",
54        "Operating System :: POSIX",
55        "Operating System :: Microsoft :: Windows",
56        "Topic :: Internet",
57        "Topic :: Software Development :: Libraries :: Python Modules",
58        "Intended Audience :: Developers",
59    ],
60    keywords='websockets',
61    scripts=["bin/wsdump.py"],
62    install_requires=install_requires,
63    packages=["websocket", "websocket.tests"],
64    package_data={
65        'websocket.tests': ['data/*.txt'],
66        'websocket': ["cacert.pem"]
67    },
68    tests_require=tests_require,
69    test_suite="websocket.tests.test_websocket",
70)
71