1 | #!/usr/bin/env python |
---|
2 | # |
---|
3 | # Michael McKerns |
---|
4 | # mmckerns@caltech.edu |
---|
5 | |
---|
6 | # check if easy_install is available |
---|
7 | try: |
---|
8 | # import __force_distutils__ #XXX: uncomment to force use of distutills |
---|
9 | from setuptools import setup |
---|
10 | has_setuptools = True |
---|
11 | except ImportError: |
---|
12 | from distutils.core import setup |
---|
13 | has_setuptools = False |
---|
14 | |
---|
15 | # build the 'setup' call |
---|
16 | setup_code = """ |
---|
17 | setup(name='mystic', |
---|
18 | version='0.1a2', |
---|
19 | description='a simple interactive inversion analysis framework', |
---|
20 | author = 'Mike McKerns, Patrick Hung', |
---|
21 | maintainer = 'Mike McKerns', |
---|
22 | maintainer_email = 'mmckerns@caltech.edu', |
---|
23 | license = 'BSD', |
---|
24 | platforms = ['any'], |
---|
25 | url = 'http://mmckerns.github.io/~mmckerns', |
---|
26 | classifiers = ('Intended Audience :: Developers', |
---|
27 | 'Programming Language :: Python', |
---|
28 | 'Topic :: Physics Programming'), |
---|
29 | |
---|
30 | packages = ['mystic','mystic.models'], |
---|
31 | package_dir = {'mystic':'mystic','mystic.models':'models'}, |
---|
32 | """ |
---|
33 | |
---|
34 | # add dependencies |
---|
35 | numpy_version = '>=1.0' |
---|
36 | matplotlib_version = '>=0.91' |
---|
37 | if has_setuptools: |
---|
38 | setup_code += """ |
---|
39 | install_requires = ('numpy%s'), |
---|
40 | """ % numpy_version |
---|
41 | |
---|
42 | # close 'setup' call |
---|
43 | setup_code += """ |
---|
44 | zip_safe=True, |
---|
45 | scripts=[]) |
---|
46 | """ |
---|
47 | |
---|
48 | # exec the 'setup' code |
---|
49 | exec setup_code |
---|
50 | |
---|
51 | # if dependencies are missing, print a warning |
---|
52 | try: |
---|
53 | import numpy |
---|
54 | #import matplotlib #XXX: has issues being zip_safe |
---|
55 | except ImportError: |
---|
56 | print "\n***********************************************************" |
---|
57 | print "WARNING: One of the following dependencies is unresolved:" |
---|
58 | print " numpy %s" % numpy_version |
---|
59 | print " matplotlib %s (optional)" % matplotlib_version |
---|
60 | print "***********************************************************\n" |
---|
61 | |
---|
62 | |
---|
63 | if __name__=='__main__': |
---|
64 | pass |
---|
65 | |
---|
66 | # end of file |
---|