forked from mdolab/pyoptsparse
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
76 lines (66 loc) · 3.2 KB
/
setup.py
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
76
from __future__ import print_function
import os
import sys
# Check if we have numpy:
try:
from numpy.distutils.misc_util import Configuration
import numpy.distutils.core
from numpy.distutils.core import setup
except:
raise ImportError('pyOptSparse requires numpy version 1.0 or later')
# HACK to make bdist_wheel command usable when using numpy.distutils.core.setup
try:
from wheel import bdist_wheel
except ImportError:
if 'bdist_wheel' in sys.argv:
print("\nThe bdist_wheel option requires the 'wheel' package to be installed.\n"
"Install it using 'pip install wheel'.")
sys.exit(-1)
else:
numpy.distutils.core.numpy_cmdclass['bdist_wheel'] = bdist_wheel.bdist_wheel
if len(sys.argv) == 1:
print("\nTo install, run: python setup.py install --user\n\n"
"To build, run: python setup.py build_ext --inplace\n\n"
"For help on C-compiler options run: python setup.py build --help-compiler\n\n"
"For help on Fortran-compiler options run: python setup.py build --help-fcompiler\n\n"
"To specify a Fortran compiler to use run: python setup.py install --user --fcompiler=<fcompiler name>\n\n"
"For further help run: python setup.py build --help"
)
sys.exit(-1)
def configuration(parent_package='', top_path=None):
config = Configuration(None, parent_package, top_path)
config.set_options(ignore_setup_xxx_py=True,
assume_default_configuration=True,
delegate_options_to_subpackages=True,
quiet=True)
config.add_subpackage('pyoptsparse')
return config
if __name__ == '__main__':
setup(
name = 'pyoptsparse',
version = '1.0.0',
author = 'Dr. Gaetan Kenway',
author_email = 'gaetank@gmail.com',
maintainer = 'Dr. Gaetan Kenway',
maintainer_email = 'gaetank@gmail.com',
description = 'Python package for formulating and solving nonlinear constrained optimization problems',
long_description = 'pyOptSparse is a Python package for formulating and solving nonlinear constrained optimization problems',
keywords = 'optimization',
license = 'GNU LGPL',
platforms = ['Windows','Linux','Solaris','Mac OS-X','Unix'],
classifiers = ['Development Status :: 5 - Production/Stable',
'Environment :: Console',
'Intended Audience :: Science/Research',
'Intended Audience :: Developers',
'Intended Audience :: Education',
'License :: LGPL',
'Operating System :: Microsoft :: Windows',
'Operating System :: POSIX :: Linux',
'Operating System :: Unix',
'Operating System :: MacOS',
'Programming Language :: Python',
'Topic :: Scientific/Engineering',
'Topic :: Software Development',
'Topic :: Education'],
configuration = configuration,
)