-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathsetup.py
121 lines (108 loc) · 4.69 KB
/
setup.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
#!/bin/env python
# -*- coding: utf-8 -*-
# Copyright (C) 2013 Fabio Falcinelli
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import sys
from setuptools import setup, find_packages
import wstunnel
__author__ = 'fabio'
kwargs = dict(name='wstunnel',
version='0.0.6',
description='A Python WebSocket Tunnel',
author='Fabio Falcinelli',
author_email='[email protected]',
url='https://github.com/ffalcinelli/wstunnel',
keywords=['tunneling', 'websocket', 'ssl'],
packages=find_packages(),
classifiers=[
'Development Status :: 2 - Pre-Alpha',
'Intended Audience :: Developers',
'Intended Audience :: System Administrators',
'Intended Audience :: Telecommunications Industry',
'License :: OSI Approved :: GNU Lesser General Public License v3 or later (LGPLv3+)',
'Programming Language :: Python',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
'Topic :: Software Development :: Libraries :: Python Modules',
'Topic :: Utilities',
],
setup_requires=['nose'],
test_suite='nose.collector')
kwargs["download_url"] = 'https://github.com/ffalcinelli/wstunnel/tarball/{0}'.format(kwargs.get("version"))
install_requires = ["PyYAML>=3.10",
"tornado>=3.0.2",
"nose>=1.3.0",
"mock>=1.0.1"]
if not sys.platform.startswith("win"):
kwargs["install_requires"] = install_requires
kwargs["entry_points"] = {
"console_scripts": [
"wstuncltd = wstunnel.daemon.wstuncltd:main",
"wstunsrvd = wstunnel.daemon.wstunsrvd:main",
]
}
else:
install_requires.extend(["pywin32>=218",
"py2exe>=0.6.9", ])
if "py2exe" in sys.argv:
if wstunnel.PY2:
from wstunnel.svc import wstunsrvd, wstuncltd
import py2exe
class Target:
def __init__(self, **kw):
self.__dict__.update(kw)
# for the versioninfo resources
self.version = kwargs["version"]
self.company_name = "N.A."
self.copyright = "Copyright (c) 2014 Fabio Falcinelli"
self.name = kwargs["name"]
tunclt_svc = Target(
# used for the versioninfo resource
description=wstuncltd.wstuncltd._svc_description_,
# what to build. For a service, the module name (not the
# filename) must be specified!
modules=["wstunnel.svc.wstuncltd"],
cmdline_style='pywin32',
)
tunsrv_svc = Target(
# used for the versioninfo resource
description=wstunsrvd.wstunsrvd._svc_description_,
# what to build. For a service, the module name (not the
# filename) must be specified!
modules=["wstunnel.svc.wstunsrvd"],
cmdline_style='pywin32',
)
kwargs["service"] = [tunclt_svc, tunsrv_svc]
kwargs["options"] = {
"py2exe": {
"compressed": 1,
"optimize": 2,
}
}
else:
sys.stderr.write("Warning: you're using python {0}.{1}.{2} "
"which is not supported yet by py2exe.\n".format(sys.version_info[0],
sys.version_info[1],
sys.version_info[2]))
sys.exit(-1)
else:
kwargs["entry_points"] = {
"console_scripts": [
"wstuncltd = wstunnel.svc.wstuncltd:main",
"wstunsrvd = wstunnel.svc.wstunsrvd:main",
]
}
setup(**kwargs)