-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathsetup.py
66 lines (51 loc) · 1.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
import os.path
from setuptools import setup, find_packages, Command
from pkg_resources import require, DistributionNotFound, VersionConflict
from collocate import __version__
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 = ["xarray"]
optional_dependencies = {'iris': 'scitools-iris'}
test_dependencies = []
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')).read()
setup(
name='collocate',
version=__version__,
description='collocate',
long_description=README,
maintainer='Duncan Watson-Parris',
maintainer_email='duncan.watson-parris@physics.ox.ac.uk',
classifiers=[
'License :: OSI Approved :: GNU Lesser General Public License v3 or later (LGPLv3+)',
'Topic :: Scientific/Engineering :: Atmospheric Science',
],
packages=find_packages(),
cmdclass={"checkdep": check_dep},
install_requires=dependencies,
extras_require=optional_dependencies,
tests_require=test_dependencies
)