forked from lijunzh/SeisCM
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
84 lines (71 loc) · 2.53 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
#!/usr/bin/env python
"""Seismic Colormap Generator"""
DOCLINES = __doc__.split("\n")
import sys
from setuptools import setup, find_packages
# Check Python version
if sys.version_info[:2] < (2, 7) or (3, 0) <= sys.version_info[0:2] < (3, 4):
raise RuntimeError("Python version 2.7 or >= 3.4 required.")
CLASSIFIERS = """\
Development Status :: 2 - Pre-Alpha
Intended Audience :: Science/Research
Intended Audience :: Developers
License :: OSI Approved :: MIT License
Programming Language :: Python
Programming Language :: Python :: 2.7
Programming Language :: Python :: 3.4
Programming Language :: Python :: 3.5
Programming Language :: Python :: 3.6
Topic :: Software Development
Topic :: Scientific/Engineering
Operating System :: Microsoft :: Windows
Operating System :: POSIX
Operating System :: Unix
Operating System :: MacOS
"""
MAJOR = 0
MINOR = 1
MICRO = 1
ISRELEASED = False
# VERSION = '{}.{}.{}'.format(MAJOR, MINOR, MICRO)
VERSION = '%d.%d.%d' % (MAJOR, MINOR, MICRO)
def setup_package():
# Figure out whether to add ``*_requires = ['numpy']``.
# We don't want to do that unconditionally, because we risk updating
# an installed numpy which fails too often. Just if it's not installed, we
# may give it a try. See gh-3379.
try:
import numpy
except ImportError: # We do not have numpy installed
build_requires = ['numpy>=1.8.2']
else:
# If we're building a wheel, assume there already exist numpy wheels
# for this platform, so it is safe to add numpy to build requirements.
# See gh-5184.
build_requires = (['numpy>=1.8.2'] if 'bdist_wheel' in sys.argv[1:]
else [])
try:
import matplotlib
except ImportError:
build_requires += ['matplotlib>=2.0.0']
metadata = dict(
name='SeisCM',
maintainer="Lijun Zhu",
version=VERSION,
maintainer_email="[email protected]",
description=DOCLINES[0],
long_description="\n".join(DOCLINES[2:]),
url="https://github.com/gatechzhu/SeisCM",
download_url="https://github.com/gatechzhu/SeisCM/releases",
license='MIT',
classifiers=[_f for _f in CLASSIFIERS.split('\n') if _f],
platforms=["Windows", "Linux", "Solaris", "Mac OS-X", "Unix"],
test_suite='tests',
packages=find_packages(),
setup_requires=build_requires,
install_requires=build_requires,
tests_require=build_requires + ['pytest'],
)
setup(**metadata)
if __name__ == '__main__':
setup_package()