| 1 |
|
|---|
| 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 |
|
|---|
| 30 |
|
|---|
| 31 |
|
|---|
| 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 |
|
|---|
| 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 |
|
|---|
| 53 |
|
|---|
| 54 |
|
|---|
| 55 |
|
|---|
| 56 |
|
|---|
| 57 |
|
|---|
| 58 |
|
|---|
| 59 |
|
|---|
| 60 |
|
|---|
| 61 |
|
|---|
| 62 |
|
|---|
| 63 |
|
|---|
| 64 |
|
|---|
| 65 |
return config |
|---|
| 66 |
|
|---|
| 67 |
|
|---|
| 68 |
if __name__ == "__main__": |
|---|
| 69 |
solverPaths = {} |
|---|
| 70 |
|
|---|
| 71 |
for root, dirs, files in os.walk('scikits'+os.sep+'openopt'+os.sep +'solvers'): |
|---|
| 72 |
|
|---|
| 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 |
|
|---|
| 87 |
|
|---|
| 88 |
|
|---|
| 89 |
|
|---|
| 90 |
|
|---|
| 91 |
|
|---|
| 92 |
|
|---|
| 93 |
setup(configuration = configuration, |
|---|
| 94 |
install_requires='numpy', |
|---|
| 95 |
namespace_packages=['scikits'], |
|---|
| 96 |
packages=setuptools.find_packages(), |
|---|
| 97 |
include_package_data = True, |
|---|
| 98 |
|
|---|
| 99 |
test_suite='', |
|---|
| 100 |
zip_safe=False, |
|---|
| 101 |
|
|---|
| 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 |
) |
|---|