-
Notifications
You must be signed in to change notification settings - Fork 1
/
setup.py
76 lines (67 loc) · 2.17 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
import os
import sys
import numpy
import versioneer
from setuptools import find_packages, setup
from setuptools.extension import Extension
try:
import Cython
USE_CYTHON = True
except ImportError:
USE_CYTHON = False
if USE_CYTHON:
if not os.path.exists('hvwfg/wfg.pyx'):
ext = '.c'
else:
ext = '.pyx'
elif os.path.exists('hvwfg/wfg.c'):
ext = '.c'
else:
raise RuntimeError("Cython must be installed")
if sys.platform in ['darwin', 'linux', 'bsd']:
extra_compile_args = ['-O3']
elif sys.platform in ['win32']:
extra_compile_args = ['/Ox']
ext_modules = [
Extension("hvwfg.{}".format(name),
sources=["hvwfg/{}{}".format(name, ext)],
include_dirs=[numpy.get_include()],
extra_compile_args=extra_compile_args)
for name in ['wfg', 'hv4dr', 'hv5dr']
]
if USE_CYTHON:
from Cython.Build import cythonize
ext_modules = cythonize(ext_modules)
here = os.path.abspath(os.path.dirname(__file__))
# Get the long description from the README file
with open(os.path.join(here, 'README.md'), encoding='utf-8') as f:
long_description = f.read()
setup(
name="hvwfg",
version=versioneer.get_version(),
cmdclass=versioneer.get_cmdclass(),
description="Python wrapper of the WFG hypervolume calculation functions",
long_description=long_description,
long_description_content_type='text/markdown',
author="Cyril Picard",
author_email='[email protected]',
classifiers=[
'Development Status :: 5 - Production/Stable',
'Intended Audience :: Science/Research',
'Topic :: Scientific/Engineering',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
],
packages=find_packages(),
ext_modules=ext_modules,
project_urls={ # Optional
'Bug Reports': 'https://github.com/epfl-lamd/hvwfg/issues',
'Source': 'https://github.com/epfl-lamd/hvwfg',
},
url='https://github.com/epfl-lamd/hvwfg',
license='GPL3',
setup_requires=['pytest-runner', 'cython', 'numpy'],
install_requires=['numpy'],
tests_require=['pytest', 'deap']
)