forked from syrgak/locust-swarm
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsetup.py
88 lines (66 loc) · 2.02 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
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import re
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
packages = [
'locust_swarm',
'locust_swarm.providers',
]
here = os.path.dirname(os.path.realpath(__file__))
# Metadata
meta = {}
re_meta = re.compile(r'__(\w+?)__\s*=\s*(.*)')
re_version = re.compile(r'VERSION\s*=.*?\((.*?)\)')
strip_quotes = lambda s: s.strip("\"'")
def add_version(match):
return {'VERSION': match.group(1).replace(" ", "").replace(",", ".")}
def add_meta(match):
attr_name, attr_value = m.groups()
return {attr_name: strip_quotes(attr_value)}
patterns = {
re_meta: add_meta,
re_version: add_version
}
with open(os.path.join(here, 'locust_swarm/__init__.py'), 'r') as f:
for line in f:
for pattern, handler in patterns.items():
m = pattern.match(line.strip())
if m:
meta.update(handler(m))
# Requires
requires = ['locustio', 'pyzmq', 'boto', 'fabric']
tests_require = ['flake8', 'mock', 'nose>=1.3', 'nosexcover']
with open(os.path.join(here, 'README.rst')) as f:
readme = f.read()
with open(os.path.join(here, 'CHANGES')) as f:
changes = f.read()
classifiers = [
'Development Status :: 3 - Alpha',
'Intended Audience :: Developers',
'Programming Language :: Python',
'License :: OSI Approved :: MIT License',
'Topic :: Utilities'
]
setup(
name='locust-swarm',
version=meta['VERSION'],
description='Script to bring up a locust master/slave cluster in EC2',
long_description=readme + '\n\n' + changes,
author=meta['author'],
author_email=meta['email'],
url="https://github.com/ryankanno/locust-swarm",
packages=packages,
package_data={'': ['LICENSE']},
package_dir={'locust_swarm': 'locust_swarm'},
scripts=['bin/locust-swarm.py'],
install_requires=requires,
license=meta['license'],
tests_require=tests_require,
classifiers=classifiers,
setup_requires=['nose>=1.3']
)
# vim: filetype=python