-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsetup.py.distutils
More file actions
75 lines (65 loc) · 2.18 KB
/
setup.py.distutils
File metadata and controls
75 lines (65 loc) · 2.18 KB
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
from distutils.core import setup
from distutils.command.install import INSTALL_SCHEMES
from os import sys
import os
import re
from importlib.util import find_spec
#from imp import find_module # This is deprecated in the latest python
for scheme in INSTALL_SCHEMES.values():
scheme['data'] = scheme['purelib']
try:
find_spec('numpy')
except ImportError:
sys.exit('### Error: python module numpy not found')
try:
find_spec('scipy')
except ImportError:
sys.exit('### Error: python module scipy not found')
try:
find_spec('astropy')
except ImportError:
sys.exit('### Error: Neither astropy nor pyfits found.')
try:
find_spec('matplotlib')
except ImportError:
sys.exit('### Error: python module matplotlib not found')
try:
find_spec('cdfutils')
except ImportError:
sys.exit('\n*** Error: python module cdfutils not found. ***\n '
'Download and install: https://github.com/cdfassnacht/cdfutils\n')
try:
find_spec('specim')
except ImportError:
sys.exit('\n*** Error: python module specim not found. ***\n'
'Download and install: https://github.com/cdfassnacht/specim\n')
verstr = "unknown"
try:
parentdir = os.getcwd()+'/'
verstrline = open(parentdir+'/src/_version.py', "rt").read()
except EnvironmentError:
pass # Okay, there is no version file.
else:
VSRE = r"^__version__ = ['\"]([^'\"]*)['\"]"
mo = re.search(VSRE, verstrline, re.M)
if mo:
verstr = mo.group(1)
else:
errstr = 'unable to find version in %s+src/_version.py' % parentdir
raise RuntimeError(errstr)
setup(
name = 'keckcode',
version = verstr,
author = 'Chris Fassnacht',
author_email = 'cdfassnacht@ucdavis.edu',
scripts=[],
#url = 'lcogt.net',
license = 'LICENSE.txt',
description = 'Code for analyzing data from various Keck instruments',
long_description = open('README.txt').read(),
requires = ['numpy', 'scipy', 'astropy', 'matplotlib', 'cdfutils'],
packages = ['keckcode', 'keckcode.osiris', 'keckcode.esiredux',
'keckcode.nires', 'keckcode.spectra', 'keckcode.deimos'],
# package_dir = {'':'src'},
package_data = {'keckcode.esiredux' : ['data/*']}
)