-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathsetup.py
73 lines (65 loc) · 2.7 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
#!/usr/bin/env python
"""Setup script for dbprocessing"""
use_setuptools = False
try:
import setuptools
import setuptools.command.sdist
use_setuptools = True
except ImportError:
import distutils.core
import distutils.command.sdist
import glob
import os
import os.path
import subprocess
class sdist((setuptools.command.sdist if use_setuptools
else distutils.command.sdist).sdist):
"""Rebuild docs before making a source distribution"""
def run(self):
self.run_command('build') # So sphinx finds latest docstrings
thisdir = os.path.abspath(os.path.dirname(__file__))
builddir = os.path.join(os.path.join(thisdir, 'sphinx', 'build',
'doctrees'))
indir = os.path.join(thisdir, 'docs')
outdir = os.path.join(thisdir, 'sphinx', 'build', 'html')
cmd = [os.environ.get('SPHINXBUILD', 'sphinx-build'),
'-b', 'html', '-d', builddir, indir, outdir]
subprocess.check_call(cmd)
(setuptools.command.sdist if use_setuptools
else distutils.command.sdist).sdist.run(self)
scripts = glob.glob(os.path.join('scripts', '*.py'))
setup_kwargs = {
'author': 'dbprocessing team',
'author_email': '[email protected]',
'classifiers': ['Development Status :: 4 - Beta',
'Intended Audience :: Science/Research',
'License :: OSI Approved :: BSD License',
'Operating System :: POSIX',
'Operating System :: POSIX :: Linux',
'Programming Language :: Python',
'Programming Language :: Python :: 3',
'Topic :: Scientific/Engineering :: Astronomy',
'Topic :: Scientific/Engineering :: Atmospheric Science',
'Topic :: Scientific/Engineering :: Physics'],
'cmdclass': {'sdist': sdist},
'description': 'database-driven Heliophysics processing controller',
'keywords': ['Heliophysics', 'data.processing'],
'license': 'BSD',
'long_description': 'database-driven Heliophysics processing controller',
'maintainer': 'Jonathan Niehof, Denis Nadeau',
'maintainer_email': '[email protected]',
'name': 'dbprocessing',
'packages': ['dbprocessing'],
'platforms': ['Linux', 'Unix'],
'provides': ['dbprocessing'],
'requires': ['python (>=2.7, !=3.0)', 'python_dateutil', 'sqlalchemy'],
'scripts': scripts,
'url': 'https://spacepy.github.io/dbprocessing/',
'version': '0.1.1rc0',
}
if use_setuptools:
setup_kwargs['install_requires'] = [
'python_dateutil',
'sqlalchemy',
]
(setuptools if use_setuptools else distutils.core).setup(**setup_kwargs)