forked from eqcorrscan/RT_EQcorrscan
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
88 lines (75 loc) · 2.79 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
from __future__ import print_function
try:
# use setuptools if we can
from setuptools import setup
using_setuptools = True
except ImportError:
from distutils.core import setup
using_setuptools = False
import glob
import os
import sys
import shutil
import rt_eqcorrscan
VERSION = rt_eqcorrscan.__version__
long_description = '''
Real-time EQcorrscan: Real-time wrappers for EQcorrscan's earthquake detection
methods.
'''
scriptfiles = [f for f in glob.glob("scripts/*") if os.path.isfile(f)]
def setup_package():
# Figure out whether to add ``*_requires = ['numpy']``.
build_requires = []
try:
import numpy
except ImportError:
build_requires = ['numpy>=1.6, <2.0']
install_requires = [
'numpy>=1.12', 'matplotlib>=1.3.0', 'scipy>=0.18', 'LatLon',
'bottleneck', 'bokeh', 'obspy>=1.0.3', 'h5py', 'eqcorrscan>=0.3.0',
'obsplus']
setup_args = {
'name': 'RT-EQcorrscan',
'version': VERSION,
'description': 'RT-EQcorrscan - Real-time matched-filter detection',
'long_description': long_description,
'url': 'https://github.com/calum-chamberlain/EQcorrscan',
'author': 'Calum Chamberlain',
'author_email': 'calum.chamberlain@vuw.ac.nz',
'license': 'LGPL',
'classifiers': [
'Development Status :: 4 - Beta',
'Intended Audience :: Science/Research',
'Topic :: Scientific/Engineering',
'License :: OSI Approved :: GNU Library or Lesser General Public '
'License (LGPL)',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
],
'keywords': 'real-time earthquake correlation detection match-filter',
'scripts': scriptfiles,
'install_requires': install_requires,
'setup_requires': ['pytest-runner'],
'tests_require': ['pytest>=2.0.0', 'pytest-cov', 'pytest-pep8',
'pytest-xdist', 'pytest-rerunfailures',
'obspy>=1.1.0'],
}
if using_setuptools:
setup_args['setup_requires'] = build_requires
setup_args['install_requires'] = install_requires
if len(sys.argv) >= 2 and (
'--help' in sys.argv[1:] or
sys.argv[1] in ('--help-commands', 'egg_info', '--version',
'clean')):
# For these actions, NumPy is not required.
pass
else:
setup_args['packages'] = [
'rt_eqcorrscan', 'rt_eqcorrscan.config', 'rt_eqcorrscan.database',
'rt_eqcorrscan.event_trigger', 'rt_eqcorrscan.plotting',
'rt_eqcorrscan.reactor', 'rt_eqcorrscan.streaming']
if os.path.isdir("build"):
shutil.rmtree("build")
setup(**setup_args)
if __name__ == '__main__':
setup_package()