forked from andim/scipydirect
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
67 lines (59 loc) · 2.56 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
import setuptools
DISTNAME = "scipydirect"
DESCRIPTION = "Python wrapper to the DIRECT algorithm"
LONG_DESCRIPTION ="""
DIRECT is a method to solve global bound constraint optimization problems and
was originally developed by D. R. Jones, C. D. Perttunen and B. E. Stuckmann.
The scipydirect is a fork of pydirect providing a scipy.optimize compatible
syntax. It uses the Fortan implementation of DIRECT written by
Joerg M Gablonsky, DIRECT Version 2.0.4.
"""
MAINTAINER = "Andreas Mayer"
MAINTAINER_EMAIL = "andimscience@gmail.com"
URL = "http://github.com/andim/scipydirect"
LICENSE = "MIT"
VERSION = "1.0"
classifiers = ['Development Status :: 5 - Production/Stable',
'Programming Language :: Python',
'License :: OSI Approved :: MIT License',
'Intended Audience :: Science/Research',
'Topic :: Scientific/Engineering',
'Topic :: Scientific/Engineering :: Mathematics',
'Operating System :: OS Independent']
def configuration(parent_package='',top_path=None):
from numpy.distutils.misc_util import Configuration
config = Configuration(DISTNAME, parent_package, top_path,
version=VERSION,
maintainer=MAINTAINER,
maintainer_email=MAINTAINER_EMAIL,
description=DESCRIPTION,
license=LICENSE,
url=URL,
long_description=LONG_DESCRIPTION)
return config
if __name__ == "__main__":
from numpy.distutils.core import setup
kwargs = dict(
packages=setuptools.find_packages(),
include_package_data=True,
platforms=["any"],
requires=["numpy"],
tests_require=['nose',],
test_suite='nose.collector',
zip_safe=True,
classifiers=classifiers,
)
try:
thiskwargs = kwargs.copy()
config = configuration()
config.add_extension('direct', sources=['src/direct.pyf', 'src/DIRect.f', 'src/DIRserial.f', 'src/DIRsubrout.f'])
thiskwargs.update(config.todict())
setup(**thiskwargs)
except:
# if there was an error try building module without Fortran extension
# the module will not be usable, but documentation can be built
# (for readthedocs)
thiskwargs = kwargs.copy()
config = configuration()
thiskwargs.update(config.todict())
setup(**thiskwargs)