forked from rueckstiess/mtools
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
112 lines (98 loc) · 3.82 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
#!/usr/bin/env python3
"""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
python_requires='>=3.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.
base_extras_requires = ['python-dateutil>=2.8.2,<3.0.0']
extras_requires = {
"all": ['numpy>=1.21.6', 'matplotlib>=3.5.3,<4.0.0', 'pymongo>=4.3.2,<5.0.0',
'psutil>=5.9.3,<6.0.0', 'packaging>=21.3'] + base_extras_requires,
"mlaunch": ['pymongo>=4.3.2,<5.0.0', 'psutil>=5.9.3,<6.0.0', 'packaging>=21.3'] + base_extras_requires,
"mlogfilter": base_extras_requires.copy(),
"mloginfo": ['numpy>=1.21.6'] + base_extras_requires,
"mplotqueries": ['numpy>=1.21.6', 'matplotlib>=3.5.3,<4.0.0'] + base_extras_requires,
"mtransfer": ['pymongo>=4.3.2,<5.0.0', 'wiredtiger>=3.2.1'] + base_extras_requires,
}
install_requires = []
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.mplotqueries',
'mtools.mtransfer',
'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,
entry_points={
"console_scripts": [
"mlaunch=mtools.mlaunch.mlaunch:main",
"mlogfilter=mtools.mlogfilter.mlogfilter:main",
"mloginfo=mtools.mloginfo.mloginfo:main",
"mplotqueries=mtools.mplotqueries.mplotqueries:main",
"mtransfer=mtools.mtransfer.mtransfer: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.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11'
],
keywords='MongoDB logs testing',
extras_require=extras_requires,
**kws
)