forked from AndriyMulyar/sklearn-oblique-tree
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
96 lines (79 loc) · 2.81 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
91
92
93
94
95
96
from setuptools import setup, find_packages
from setuptools.command.test import test as TestCommand
from setuptools.extension import Extension
# from Cython.Build import cythonize
from sklearn_oblique_tree import __authors__, __version__
import numpy, sys
packages = find_packages()
extensions = [
Extension(
"sklearn_oblique_tree.oblique._oblique",
[
"sklearn_oblique_tree/oblique/_oblique.pyx",
"oc1_source/load_data.c",
# "oc1_source/train_util.c",
"oc1_source/perturb.c",
"oc1_source/classify.c",
"oc1_source/compute_impurity.c",
"oc1_source/impurity_measures.c",
"oc1_source/prune.c",
"oc1_source/util.c",
# "oc1_source/classify_util.c",
"oc1_source/tree_util.c",
],
include_dirs=[numpy.get_include(), "."],
extra_compile_args=[
"-w",
"-Wno-return-type",
"-fcommon",
],
)
]
# util.c tree_util.c load_data.c perturb.c compute_impurity.c impurity_measures.c classify.c prune.c
def readme():
with open("README.md") as f:
return f.read()
class PyTest(TestCommand):
"""
Custom Test Configuration Class
Read here for details: https://docs.pytest.org/en/latest/goodpractices.html
"""
user_options = [("pytest-args=", "a", "Arguments to pass to pytest")]
def initialize_options(self):
TestCommand.initialize_options(self)
self.pytest_args = ""
def run_tests(self):
import shlex
# import here, cause outside the eggs aren't loaded
import pytest
errno = pytest.main(shlex.split(self.pytest_args))
sys.exit(errno)
setup(
name="sklearn-oblique-tree",
version=__version__,
license="GNU GENERAL PUBLIC LICENSE",
description="a python interface to oblique decision tree implementations",
long_description=readme(),
packages=packages,
url="https://github.com/AndriyMulyar/sklearn-oblique-tree",
author=__authors__,
author_email="contact@andriymulyar.com",
keywords="scikit-learn oblique-classifier-1 oc1 oblique-decision-tree decision-tree",
classifiers=[
"( Status :: 4 - Beta",
"License :: OSI Approved :: GNU General Public License (GPL)",
"Programming Language :: Python :: 3.5",
"Natural Language :: English",
"Topic :: Scientific/Engineering :: Artificial Intelligence",
"Intended Audience :: Science/Research",
],
install_requires=["scikit-learn>=0.20.0", "numpy"],
# ext_modules=cythonize(extensions, gdb_debug=False),
ext_modules=extensions,
# testing
tests_require=["pytest"],
cmdclass={"pytest": PyTest},
# include external data (murphy's oc1 implementation)
include_package_data=True,
zip_safe=False,
)