root/trunk/openopt/setup.py

Revision 1485, 4.0 kB (checked in by dmitrey.kroshko, 2 months ago)

minor change for setup.py

Line 
1 #! /usr/bin/env python
2
3 descr   = """
4 """
5
6 from os.path import join
7 import os
8 import sys, compileall
9
10 DISTNAME            = 'scikits.openopt'
11 DESCRIPTION         = 'A python module for numerical optimization'
12 LONG_DESCRIPTION    = descr
13 MAINTAINER          = 'mainteiner of OpenOpt is Dmitrey Kroshko, mainteiner of GenericOpt is Matthieu Brucher',
14 MAINTAINER_EMAIL    = 'dmitrey.kroshko@scipy.org',
15 URL                 = 'http://projects.scipy.org/scipy/scikits',
16 LICENSE             = 'new BSD'
17
18 openopt_version = 0.19
19
20 DOWNLOAD_URL        = 'http://scipy.org/scipy/scikits/attachment/wiki/OpenOptInstall/openopt' + str(openopt_version) + '.tar.bz2'
21
22 import setuptools, string, shutil
23 from distutils.errors import DistutilsError
24 from numpy.distutils.system_info import system_info, NotFoundError, dict_append, so_ext
25 from numpy.distutils.core import setup, Extension
26 import os, sys
27
28 DOC_FILES = []
29 ##from scikits import openopt
30 ##from openopt.info import __version__ as openopt_version
31 #from scikits.openopt.info import __version__ as openopt_version
32 from shutil import copytree, rmtree
33
34
35 def configuration(parent_package='',top_path=None, package_name=DISTNAME):
36     if os.path.exists('MANIFEST'): os.remove('MANIFEST')
37     pkg_prefix_dir = os.path.join('scikits', 'openopt')
38
39     # Get the version
40
41
42     from numpy.distutils.misc_util import Configuration
43     config = Configuration(package_name,parent_package,top_path,
44         version     = openopt_version,
45         maintainer  = MAINTAINER,
46         maintainer_email = MAINTAINER_EMAIL,
47         description = DESCRIPTION,
48         license = LICENSE,
49         url = URL,
50         download_url = DOWNLOAD_URL,
51         long_description = LONG_DESCRIPTION)
52     #config.add_data_dir(('src', 'scikits'))
53     #config.add_data_dir(('openopt', 'scikits'))
54
55
56     # XXX: once in SVN, should add svn version...
57     #print config.make_svn_version_py()
58
59     # package_data does not work with sdist for setuptools 0.5 (setuptools bug),
60     # so we need to add them here while the bug is not solved...
61     #config.add_data_files(('docs', ['scikits/openopt/docs/' + i for i in DOC_FILES]))
62
63     #config.add_data_dir(('examples', 'scikits/openopt/docs/examples'))
64
65     return config
66
67
68 if __name__ == "__main__":
69     solverPaths = {}
70     #File = string.join(__file__.split(os.sep)[:-1], os.sep)
71     for root, dirs, files in os.walk('scikits'+os.sep+'openopt'+os.sep +'solvers'):
72         #for root, dirs, files in os.walk(os.path.dirname(file)+os.sep+'solvers'):
73         rd = root.split(os.sep)
74         if '.svn' in rd: continue
75         rd = rd[rd.index('solvers')+1:]
76         for file in files:
77             if len(file)>6 and file[-6:] == '_oo.py':
78                 solverPaths[file[:-6]] = 'scikits.openopt.solvers.' + string.join(rd,'.') + '.'+file[:-3]
79     f = open('solverPaths.py', 'w')
80     f.write('solverPaths = ' + str(solverPaths))
81     f.close()
82     shutil.move('solverPaths.py', 'scikits' + os.sep + 'openopt' + os.sep +'Kernel' + os.sep + 'solverPaths.py')
83
84
85
86     # setuptools version of config script
87
88     # package_data does not work with sdist for setuptools 0.5 (setuptools bug)
89     # So we cannot add data files via setuptools yet.
90
91     #data_files = ['test_data/' + i for i in TEST_DATA_FILES]
92     #data_files.extend(['docs/' + i for i in doc_files])
93     setup(configuration = configuration,
94         install_requires='numpy', # can also add version specifiers
95         namespace_packages=['scikits'],
96         packages=setuptools.find_packages(),
97         include_package_data = True,
98         #package_data = '*.txt',
99         test_suite='',#"scikits.openopt.tests", # for python setup.py test
100         zip_safe=False, # the package can run out of an .egg file
101         #FIXME url, download_url, ext_modules
102         classifiers =
103             [ 'Development Status :: 4 - Beta',
104               'Environment :: Console',
105               'Intended Audience :: Developers',
106               'Intended Audience :: Science/Research',
107               'License :: OSI Approved :: BSD License',
108               'Topic :: Scientific/Engineering']
109     )
Note: See TracBrowser for help on using the browser.