-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
49 lines (41 loc) · 1.21 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
#!/usr/bin/env python
from setuptools import setup
import re
import os
_packages = {
'rate_limiter': 'rate_limiter',
}
def my_test_suite():
import asynctest
test_loader = asynctest.TestLoader()
test_suite = test_loader.discover('tests')
return test_suite
def read_version():
regexp = re.compile(r"^__version__\W*=\W*'([\d.abrc]+)'")
init_py = os.path.join(os.path.dirname(__file__),
'rate_limiter', '__init__.py')
with open(init_py) as f:
for line in f:
match = regexp.match(line)
if match is not None:
return match.group(1)
else:
raise RuntimeError('Cannot find version in '
'rate_limiter/__init__.py')
setup(
name="rate-limiter",
version=read_version(),
description='Rate Limiter',
classifiers=[
'Intended Audience :: Developers',
'Programming Language :: Python :: 3.6',
],
author='Alexander Mohr',
author_email='[email protected]',
url='https://github.com/thehesiod/rate_limiter',
package_dir=_packages,
packages=list(_packages.keys()),
install_requires=[
],
test_suite='setup.my_test_suite',
)