-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
134 lines (118 loc) · 3.53 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
122
123
124
125
126
127
128
129
130
131
132
133
134
import ast
import os
import re
import setuptools
from setuptools.command.test import test as TestCommand
install_requires = [
'uvloop',
]
tests_require = install_requires + [
]
ext_modules = [
setuptools.Extension(
"leave.protocol",
sources=[
"leave/protocol.c",
],
extra_compile_args=['-O3'],
include_dirs=[
'./vendors/httpparser/httpparser',
'./vendors/r3py/r3py',
],
extra_objects=[
'./vendors/r3py/vendors/r3/src/edge.o',
'./vendors/r3py/vendors/r3/src/match_entry.o',
'./vendors/r3py/vendors/r3/src/memory.o',
'./vendors/r3py/vendors/r3/src/node.o',
'./vendors/r3py/vendors/r3/src/slug.o',
'./vendors/r3py/vendors/r3/src/str.o',
'./vendors/r3py/vendors/r3/src/token.o',
'./vendors/r3py/vendors/r3/3rdparty/libr3ext_la-zmalloc.o'
],
libraries=['pcre'],
),
setuptools.Extension(
"leave.request",
sources=[
"leave/request.c",
],
extra_compile_args=['-O3'],
extra_objects=[
'./vendors/httpparser/picohttpparser.o',
],
include_dirs=[
'./vendors/httpparser/httpparser',
'./vendors/r3py/r3py',
],
),
setuptools.Extension(
"leave.response",
sources=[
"leave/response.c",
],
extra_compile_args=['-O3'],
extra_objects=[
'./vendors/httpparser/picohttpparser.o',
'./http.o',
],
include_dirs=[
'./vendors/httpparser/httpparser',
'./vendors/r3py/r3py',
],
),
]
dependency_links = []
entry_points = {}
_version_re = re.compile(r'__version__\s+=\s+(.*)')
with open('leave/__init__.py', 'rb') as f:
__version__ = str(ast.literal_eval(_version_re.search(
f.read().decode('utf-8')).group(1)))
class Tox(TestCommand):
user_options = [('tox-args=', 'a', "Arguments to pass to tox")]
def initialize_options(self):
TestCommand.initialize_options(self)
self.tox_args = None
def finalize_options(self):
TestCommand.finalize_options(self)
self.test_args = []
self.test_suite = True
def run_tests(self):
import tox
import shlex
args = self.tox_args
if args:
args = shlex.split(self.tox_args)
tox.cmdline(args=args)
try:
current_dir = os.path.abspath(os.path.dirname(__file__))
README = open(os.path.join(current_dir, 'README.md')).read()
CHANGES = open(os.path.join(current_dir, 'CHANGES.txt')).read()
except IOError:
README = CHANGES = ''
setuptools.setup(
name="leave",
version=__version__,
description=(""),
long_description=README + "\n\n" + CHANGES,
classifiers=[
'Programming Language :: C',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: Implementation :: CPython',
'Topic :: Internet :: WWW/HTTP',
],
keywords='',
author="Aleksei Sargin",
author_email="[email protected]",
url="https://github.com/dontcare/leave",
packages=['httpparser'] + setuptools.find_packages(),
include_package_data=True,
zip_safe=False,
install_requires=install_requires,
tests_require=tests_require,
dependency_links=dependency_links,
test_suite='tests',
entry_points=entry_points,
cmdclass=dict(test=Tox),
ext_modules=ext_modules,
)