forked from cjtu/craterpy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
96 lines (85 loc) · 3.08 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
"""Installation script.
"""
from setuptools import setup, find_packages
from codecs import open
from os import path
here = path.abspath(path.dirname(__file__))
def get_version():
""" Fetch version from version.py """
version = {}
with open(path.join(here, 'craterpy', 'version.py')) as f:
exec(f.read(), version)
return version['__version__']
def get_readme():
""" Fetch long winded description from /README.rst """
with open(path.join(here, 'README.rst'), encoding='utf-8') as f:
return f.read()
def try_BuildDoc():
"""Try to import BuildDoc (incompatible with py2)"""
try:
from sphinx.setup_command import BuildDoc
return {'build_docs': BuildDoc}
except ImportError:
print("Warning: sphinx.setup_command unavailable. Docs not built")
return {}
# Set package metadata
NAME = 'craterpy'
VERSION = get_version()
DESCRIPTION = 'A package for impact crater data science.'
LONG_DESCRIPTION = get_readme()
AUTHOR = 'Christian Tai Udovicic'
AUTHOR_EMAIL = 'cj.taiudovicic@gmail.com'
MAINTAINER = AUTHOR
MAINTAINER_EMAIL = AUTHOR_EMAIL
URL = 'http://github.com/cjtu/craterpy'
LICENSE = 'MIT'
CLASSIFIERS = ['Development Status :: 3 - Alpha',
'Intended Audience :: Science/Research',
'License :: OSI Approved :: MIT License',
'Natural Language :: English',
'Operating System :: OS Independent',
'Topic :: Scientific/Engineering :: Astronomy',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5']
KEYWORDS = 'python crater data analysis planetary science'
PLATFORMS = 'OS Independent'
PACKAGES = find_packages(exclude=['tests'])
PACKAGE_DATA = {'': ['*.csv', '*.tif']}
INSTALL_REQUIRES = ['numpy', 'scipy', 'pandas', 'matplotlib', 'gdal']
# PYTHON_REQUIRES = '>=2.7, <=3.3'
EXTRAS_REQUIRE = None # {'test': ['pytest'], 'cite': ['duecredit'],}
# Setup Sphinx integration to automatically build documentation
CMDCLASS = try_BuildDoc()
COMMAND_OPTIONS = { # Overrides docs/conf.py settings
'build_docs': {
'project': ('setup.py', NAME),
'version': ('setup.py', VERSION),
'release': ('setup.py', VERSION),
'source_dir': ('setup.py', './docs/source'),
'build_dir': ('setup.py', './docs/build')}}
# Run setup() function with metadata above
setup(
name=NAME,
version=VERSION,
description=DESCRIPTION,
long_description=LONG_DESCRIPTION,
maintainer=MAINTAINER,
maintainer_email=MAINTAINER_EMAIL,
url=URL,
license=LICENSE,
classifiers=CLASSIFIERS,
keywords=KEYWORDS,
author=AUTHOR,
author_email=AUTHOR_EMAIL,
platforms=PLATFORMS,
packages=PACKAGES,
package_data=PACKAGE_DATA,
install_requires=INSTALL_REQUIRES,
extras_require=EXTRAS_REQUIRE,
# python_requires=PYTHON_REQUIRES,
cmdclass=CMDCLASS,
command_options=COMMAND_OPTIONS,
)