-
Notifications
You must be signed in to change notification settings - Fork 18
/
setup.py
80 lines (65 loc) · 2.38 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
import os
import os.path
from setuptools import setup, find_packages, Command
from pkg_resources import require, DistributionNotFound, VersionConflict
from cis.test.runner import nose_test
from cis import __version__, __website__
root_path = os.path.dirname(__file__)
# If we're building docs on readthedocs we don't have any dependencies as they're all mocked out
on_rtd = os.environ.get('READTHEDOCS', None) == 'True'
if on_rtd:
dependencies = []
optional_dependencies = {}
test_dependencies = []
else:
dependencies = ["matplotlib>=2.0",
"netcdf4>=1.0",
"numpy",
"scipy>=0.15.0",
"scitools-iris>=1.8.0",
"psutil>=2.0.0",
"six"]
optional_dependencies = {"HDF": ["pyhdf>=0.9.0"], "Pandas": ["pandas"]}
test_dependencies = ["pyhamcrest", "mock", "nose"]
class check_dep(Command):
"""
Command to check that the required dependencies are installed on the system
"""
description = "Checks that the required dependencies are installed on the system"
user_options = []
def initialize_options(self):
pass
def finalize_options(self):
pass
def run(self):
for dep in dependencies:
try:
require(dep)
print(dep + " ...[ok]")
except (DistributionNotFound, VersionConflict):
print(dep + "... MISSING!")
# Extract long-description from README
README = open(os.path.join(root_path, 'README.md'), 'rb').read().decode('utf-8')
setup(
name='cis',
version=__version__,
description='Community Intercomparison Suite',
long_description=README,
maintainer='Philip Kershaw',
maintainer_email='[email protected]',
url=__website__,
classifiers=[
'License :: OSI Approved :: GNU Lesser General Public License v3 or later (LGPLv3+)',
'Topic :: Scientific/Engineering :: Atmospheric Science',
'Topic :: Scientific/Engineering :: Visualization',
'Environment :: Console',
],
packages=find_packages(),
package_data={'': ['logging.conf', 'plotting/raster/*.png']},
scripts=['bin/cis', 'bin/cis.lsf'],
cmdclass={"checkdep": check_dep,
"test": nose_test},
install_requires=dependencies,
extras_require=optional_dependencies,
tests_require=test_dependencies
)