forked from mscross/pysplit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
138 lines (108 loc) · 4.17 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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
#! /usr/bin/env python
descr = """PySPLIT (a.k.a. `pysplit`): HYSPLIT Toolbox for Python.
This package is designed to be used with the desktop version of NOAA Air
Research Laboratory's HYSPLIT model (https://ready.arl.noaa.gov/HYSPLIT.php).
PySPLIT contains functions and classes ready to work with HYSPLIT to
automatically generate trajectories, and to analyze and visualize
trajectory paths and meteorology.
"""
DISTNAME = 'PySPLIT'
DESCRIPTION = 'HYSPLIT trajectory analysis, automation, & visualization'
LONG_DESCRIPTION = descr
MAINTAINER = 'Mellissa S. C. Warner'
MAINTAINER_EMAIL = '[email protected]'
LICENSE = 'Modified BSD'
DOWNLOAD_URL = ''
PYTHON_VERSION = (2, 6)
DEPENDENCIES = {'numpy': (1, 6),
'matplotlib': (1, 2),
'basemap': (1, 0),
'geopandas': (0, 1)}
import os
import sys
import re
import setuptools
import pkg_resources
from numpy.distutils.core import setup
try:
from distutils.command.build_py import build_py_2to3 as build_py
except ImportError:
from distutils.command.build_py import build_py
with open('pysplit/__init__.py') as fid:
for line in fid:
if line.startswith('__version__'):
VERSION = line.strip().split()[-1][1:-1]
break
def check_requirements():
if sys.version_info < PYTHON_VERSION:
raise SystemExit('Python version %d.%d required; found %d.%d.'
% (PYTHON_VERSION[0], PYTHON_VERSION[1],
sys.version_info[0], sys.version_info[1]))
for package_name, min_version in DEPENDENCIES.items():
dep_err = False
try:
package_version = pkg_resources.require(package_name)[0].version
except pkg_resources.DistributionNotFound:
dep_err = True
else:
package_version = get_package_version(package_version)
if not dep_err:
if min_version > package_version:
dep_err = True
if dep_err:
raise ImportError('`%s` version %d.%d or later required.'
% ((package_name, ) + min_version))
def get_package_version(package_version):
version = []
for part in re.split('\D+', package_version):
try:
version.append(int(part))
except ValueError:
pass
return tuple(version)
def configuration(parent_package='', top_path=None):
if os.path.exists('MANIFEST'):
os.remove('MANIFEST')
from numpy.distutils.misc_util import Configuration
config = Configuration(None, parent_package, top_path)
config.set_options(ignore_setup_xxx_py=True,
assume_default_configuration=True,
delegate_options_to_subpackages=True,
quiet=True)
config.add_subpackage('pysplit')
# config.add_data_dir('pysplit/data')
return config
if __name__ == '__main__':
check_requirements()
setup(
name=DISTNAME,
description=DESCRIPTION,
long_description=LONG_DESCRIPTION,
maintainer=MAINTAINER,
maintainer_email=MAINTAINER_EMAIL,
license=LICENSE,
download_url=DOWNLOAD_URL,
version=VERSION,
classifiers=[
'Development Status :: 4 - Beta',
'Environment :: Console',
'Intended Audience :: Developers',
'Intended Audience :: Science/Research',
'License :: OSI Approved :: BSD License',
'Programming Language :: Python',
'Programming Language :: Python :: 3',
'Topic :: Scientific/Engineering',
'Operating System :: Microsoft :: Windows',
'Operating System :: POSIX',
'Operating System :: Unix',
'Operating System :: MacOS'],
configuration=configuration,
packages=setuptools.find_packages(),
include_package_data=True,
zip_safe=False
)
# Not included as this package has no post-install scripts or build req:
# entry_points={
# 'console_scripts': ['skivi = skimage.scripts.skivi:main'],
# },
# cmdclass={'build_py': build_py},