forked from rueckstiess/mtools
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
111 lines (98 loc) · 3.57 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
#!/bin/python
"""Setup file for mtools."""
import platform
import re
import sys
# try importing from setuptools, if unavailable use distutils.core
try:
from setuptools import setup, find_packages
# test for 2.7-included packages, add to requirements if not available
install_requires = ['six', 'python-dateutil==2.7']
# Additional dependencies from requirements.txt that should be installed
# for full mtools feature support. These are optional dependencies to
# simplify the default install experience, particularly where a build
# toolchain is required.
extras_requires = {
"all": ['matplotlib==3.1.1', 'numpy==1.16.4', 'pymongo==3.8.0', 'psutil==5.6.3'],
"mlaunch": ['pymongo==3.8.0', 'psutil==5.6.3'],
"mlogfilter": [],
"mloginfo": ['numpy==1.16.4'],
"mlogvis": [],
"mplotqueries": ['matplotlib==3.1.1', 'numpy==1.16.4'],
}
try:
import argparse
except ImportError:
install_requires.append('argparse')
try:
from collections import OrderedDict
except ImportError:
install_requires.append('ordereddict')
packages = find_packages()
kws = {'install_requires': install_requires}
except ImportError:
from distutils.core import setup
# find_packages not available in distutils, manually define packaging
packages = ['mtools',
'mtools.mlaunch',
'mtools.mlogfilter',
'mtools.mloginfo',
'mtools.mlogvis',
'mtools.mplotqueries',
'mtools.mgenerate',
'mtools.test',
'mtools.util',
'mtools.mlogfilter.filters',
'mtools.mplotqueries.plottypes',
'mtools.mloginfo.sections']
kws = {}
# import version from mtools/version.py
with open('mtools/version.py') as f:
exec(f.read())
# read README.rst for long_description content
with open('README.rst') as f:
long_description = f.read()
if sys.platform == 'darwin' and 'clang' in platform.python_compiler().lower():
from distutils.sysconfig import get_config_vars
res = get_config_vars()
for key in ('CFLAGS', 'PY_CFLAGS'):
if key in res:
flags = res[key]
flags = re.sub('-mno-fused-madd', '', flags)
res[key] = flags
setup(
name='mtools',
version=__version__,
packages=packages,
package_data={
'mtools': ['data/log2code.pickle', 'data/index.html'],
},
entry_points={
"console_scripts": [
"mgenerate=mtools.mgenerate.mgenerate:main",
"mlaunch=mtools.mlaunch.mlaunch:main",
"mlogfilter=mtools.mlogfilter.mlogfilter:main",
"mloginfo=mtools.mloginfo.mloginfo:main",
"mlogvis=mtools.mlogvis.mlogvis:main",
"mplotqueries=mtools.mplotqueries.mplotqueries:main"
],
},
author='Thomas Rueckstiess',
author_email='[email protected]',
url='https://github.com/rueckstiess/mtools',
description=("Useful scripts to parse and visualize MongoDB log files, "
"launch test environments, and reproduce issues."),
long_description=long_description,
license='Apache 2.0',
classifiers=[
'Development Status :: 5 - Production/Stable',
'Intended Audience :: Developers',
'Topic :: Database',
'License :: OSI Approved :: Apache Software License',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
],
keywords='MongoDB logs testing',
extras_require=extras_requires,
**kws
)