-
Notifications
You must be signed in to change notification settings - Fork 22
/
setup.py
90 lines (82 loc) · 3.35 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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from setuptools import setup, find_packages
from setuptools.extension import Extension
from Cython.Build import cythonize
# the setup file relies on eigency to import its include paths for the
# extension modules. however eigency isn't known as a dependency until after
# setup is parsed; so we need to check for and install eigency before setup.
import importlib
try:
importlib.import_module('eigency')
except (ImportError, AttributeError):
try:
from pip._internal import main
main(['install', 'eigency'])
except ImportError:
raise ImportError('The eigency library must be installed before FEW. '
'Automatic install with pip failed.')
finally:
globals()['eigency'] = importlib.import_module('eigency')
def calculate_version():
initpy = open('few/_version.py').read().split('\n')
version = list(filter(lambda x: '__version__' in x, initpy))[0].split('\'')[1]
return version
package_version = calculate_version()
# few_lib = Extension(name='few_lib',
# sources=['few/lib/epsilon_lexicase.cpp'],
# include_dirs = ['/usr/include/eigen3'],
# depends = ['Eigen/Dense.h'],
# extra_compile_args = ['-std=c++0x']
# )
# check if windows or *nix
from sys import platform
print('platform:',platform)
if platform == 'win32':
eca = ''
else:
eca = '-std=c++0x'
setup(
name='FEW',
version=package_version,
author='William La Cava',
author_email='[email protected]',
packages=find_packages(),
url='https://github.com/lacava/few',
download_url='https://github.com/lacava/few/releases/tag/'+package_version,
license='GNU/GPLv3',
entry_points={'console_scripts': ['few=few:main', ]},
test_suite='nose.collector',
tests_require=['nose'],
description=('Feature Engineering Wrapper'),
long_description='''
A feature engineering wrapper for scikitlearn based on genetic programming.
Contact:
===
e-mail: [email protected]
This project is hosted at https://github.com/lacava/few
''',
zip_safe=True,
install_requires=['numpy', 'scipy', 'pandas', 'scikit-learn',
'update_checker', 'tqdm', 'joblib','DistanceClassifier',
'scikit-mdr','Cython', 'eigency'],
setup_requires=['numpy', 'scipy', 'pandas', 'scikit-learn',
'update_checker', 'tqdm', 'joblib','DistanceClassifier',
'scikit-mdr','Cython', 'eigency'],
classifiers=[
'Intended Audience :: Science/Research',
'License :: OSI Approved :: GNU General Public License v3 (GPLv3)',
# 'Programming Language :: Python :: 2.7',
# 'Programming Language :: Python :: 3',
# 'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Topic :: Scientific/Engineering :: Artificial Intelligence'
],
keywords=['data science', 'machine learning', 'classification'],
ext_modules=cythonize([Extension(name="few_lib",
sources=["few/lib/few_lib.pyx"],
include_dirs=[".", "./few/lib"] +
eigency.get_includes(),
extra_compile_args = [eca])],
language="c++")
)