forked from uber/causalml
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
48 lines (43 loc) · 1.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
from setuptools import dist, setup, find_packages
from setuptools.extension import Extension
try:
from Cython.Build import cythonize
except ImportError:
dist.Distribution().fetch_build_eggs(["cython<=0.29.34"])
from Cython.Build import cythonize
import Cython.Compiler.Options
Cython.Compiler.Options.annotate = True
try:
from numpy import get_include as np_get_include
except ImportError:
dist.Distribution().fetch_build_eggs(["numpy"])
from numpy import get_include as np_get_include
extensions = [
Extension(
"causalml.inference.tree.causal._criterion",
["causalml/inference/tree/causal/_criterion.pyx"],
libraries=[],
include_dirs=[np_get_include()],
extra_compile_args=["-O3"],
),
Extension(
"causalml.inference.tree.causal._builder",
["causalml/inference/tree/causal/_builder.pyx"],
libraries=[],
include_dirs=[np_get_include()],
extra_compile_args=["-O3"],
),
Extension(
"causalml.inference.tree.uplift",
["causalml/inference/tree/uplift.pyx"],
libraries=[],
include_dirs=[np_get_include()],
extra_compile_args=["-O3"],
),
]
packages = find_packages(exclude=["tests", "tests.*"])
setup(
packages=packages,
ext_modules=cythonize(extensions, annotate=True),
include_dirs=[np_get_include()],
)