source: branches/alta/setup_mystic-0.2a1_alta.py @ 412

Revision 412, 2.0 KB checked in by mmckerns, 6 years ago (diff)

added lines to setup for optional dependencies

Line 
1#!/usr/bin/env python
2#
3# Michael McKerns
4# mmckerns@caltech.edu
5
6# check if easy_install is available
7try:
8#   import __force_distutils__ #XXX: uncomment to force use of distutills
9    from setuptools import setup
10    has_setuptools = True
11except ImportError:
12    from distutils.core import setup
13    has_setuptools = False
14
15# build the 'setup' call
16setup_code = """
17setup(name='mystic',
18      version='0.2a1',
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.math', 'mystic.models'],
31      package_dir = {'mystic':'mystic-0.2a1','mystic.math':'mystic-0.2a1/_math', 'mystic.models':'mystic-0.1a2/models'},
32"""
33
34# add dependencies
35numpy_version = '>=1.0'
36sympy_version = '>=0.6.5'
37scipy_version = '>=0.6.0'
38matplotlib_version = '>=0.91'
39if has_setuptools:
40    setup_code += """
41      install_requires = ['numpy%s'],
42""" % numpy_version
43
44# close 'setup' call
45setup_code += """   
46      zip_safe=True,
47      scripts=[])
48"""
49
50# exec the 'setup' code
51exec setup_code
52
53# if dependencies are missing, print a warning
54try:
55    import numpy
56    #import sympy
57    #import scipy
58    #import matplotlib #XXX: has issues being zip_safe
59except ImportError:
60    print "\n***********************************************************"
61    print "WARNING: One of the following dependencies is unresolved:"
62    print "    numpy %s" % numpy_version
63    print "    sympy %s (optional)" % sympy_version
64    print "    scipy %s (optional)" % scipy_version
65    print "    matplotlib %s (optional)" % matplotlib_version
66    print "***********************************************************\n"
67
68
69if __name__=='__main__':
70    pass
71
72# end of file
Note: See TracBrowser for help on using the repository browser.