This repository has been archived by the owner on Apr 16, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathsetup.py
75 lines (60 loc) · 2.22 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
#!/usr/bin/env python
from __future__ import print_function
import os
from setuptools import setup
NAME = 'cube_browser'
DIR = os.path.abspath(os.path.dirname(__file__))
def extract_packages():
packages = []
root = os.path.join(DIR, 'lib', NAME)
offset = len(os.path.dirname(root)) + 1
for dpath, dnames, fnames in os.walk(root):
if os.path.exists(os.path.join(dpath, '__init__.py')):
package = dpath[offset:].replace(os.path.sep, '.')
packages.append(package)
return packages
def extract_version():
version = None
fname = os.path.join(DIR, 'lib', NAME, '__init__.py')
with open(fname) as fin:
for line in fin:
if (line.startswith('__version__')):
_, version = line.split('=')
version = version.strip()[1:-1] # Remove quotation.
break
return version
def extract_description():
description = 'Cube Browser'
fname = os.path.join(DIR, 'README.md')
if os.path.isfile(fname):
with open(fname) as fin:
description = fin.read()
return description
install_requires = ['iris']
setup_args = dict(
name = NAME,
version = extract_version(),
description = 'Cube Browser.',
long_description = extract_description(),
platforms = ['Linux', 'Mac OS X', 'Windows'],
license = 'BSD 3-clause',
url = 'https://github.com/SciTools/cube_browser',
package_dir = {'': 'lib'},
packages = extract_packages(),
classifiers = [
'License :: OSI Approved :: BSD License',
'Development Status :: 1 - Planning Development Status',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Operating System :: OS Independent',
'Intended Audience :: Science/Research',
'Intended Audience :: Developers',
'Natural Language :: English',
'Topic :: Scientific/Engineering',
'Topic :: Software Development :: Libraries'],
install_requires = install_requires,
test_suite = '{}.tests'.format(NAME),
)
if __name__ == "__main__":
setup(**setup_args)