-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathsetup.py
68 lines (56 loc) · 2.09 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
from setuptools import Extension
from distutils.core import setup
from setuptools.command.test import test as TestCommand
from Cython.Distutils import build_ext
from Cython.Build import cythonize
import sys
# cython = Extension('ea.cbenchmarks',
# sources = ['ea/cbenchmarks.pyx'],
# include_dirs = ['include/']
# )
sourcefiles = ['cec2013lsgo/cec2013.pyx']
sourcefiles += ['cec2013lsgo/eval_func.cpp', 'cec2013lsgo/Benchmarks.cpp']
for i in range(1, 16):
sourcefiles += ['cec2013lsgo/F%d.cpp' % i]
cec2013lsgo = Extension("cec2013lsgo.cec2013",
sourcefiles,
language="c++",
extra_compile_args=["-std=c++11"],
libraries=["m"]) # Unix-like specific
class PyTest(TestCommand):
user_options = [('pytest-args=', 'a', "Arguments to pass to py.test")]
def initialize_options(self):
TestCommand.initialize_options(self)
self.pytest_args = []
def finalize_options(self):
TestCommand.finalize_options(self)
self.test_args = []
self.test_suite = True
def run_tests(self):
#import here, cause outside the eggs aren't loaded
import pytest
errno = pytest.main(self.pytest_args)
sys.exit(errno)
setup(
name='cec2013lsgo',
version='2.0',
author='Daniel Molina',
author_email='[email protected]',
maintainer='Daniel Molina',
description='Package for benchmark for the Real \
Large Scale Global Optimization session on IEEE \
Congress on Evolutionary Computation CEC\'2013',
long_description=open('README.rst').read(),
license='GPL V3',
url='https://github.com/dmolina/cec2013lsgo',
packages=['cec2013lsgo'],
install_requires=['cython', 'numpy'],
ext_modules=cythonize(cec2013lsgo),
package_data={'cec2013lsgo': ['cdatafiles/*.txt']},
tests_require=['pytest'],
cmdclass={'build_ext': build_ext, 'test': PyTest},
classifiers=[
'Development Status :: 5 - Production/Stable',
'License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)',
]
)