-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
104 lines (88 loc) · 2.68 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
import ast
import os
import re
import setuptools
from setuptools.command.test import test as TestCommand
install_requires = [
]
tests_require = install_requires + [
]
ext_modules = [
setuptools.Extension(
"r3py.r3",
sources=[
"r3py/r3.c",
],
extra_compile_args=['-O2'],
include_dirs=['./verndors/'],
extra_objects=[
'./vendors/r3/src/edge.o',
'./vendors/r3/src/match_entry.o',
'./vendors/r3/src/memory.o',
'./vendors/r3/src/node.o',
'./vendors/r3/src/slug.o',
'./vendors/r3/src/str.o',
'./vendors/r3/src/token.o',
'./vendors/r3/3rdparty/libr3ext_la-zmalloc.o'
],
libraries=['pcre'],
),
]
dependency_links = []
entry_points = {}
_version_re = re.compile(r'__version__\s+=\s+(.*)')
with open('r3py/__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="r3py",
version=__version__,
description=(""),
long_description=README + "\n\n" + CHANGES,
license='MIT License',
platforms=['*nix', 'OSX'],
classifiers=[
'Programming Language :: C',
'Programming Language :: Python :: 2.7',
'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/r3py",
packages=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,
)