-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
49 lines (42 loc) · 1.34 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
import sys
import numpy
from setuptools import Extension, setup
lib_talib_name = "ta_lib" # the underlying C library's name
if any(s in sys.platform for s in ["darwin", "linux", "bsd", "sunos"]):
include_dirs = [
"/usr/include",
"/usr/local/include",
"/opt/include",
"/opt/local/include",
"/opt/homebrew/include",
"/opt/homebrew/opt/ta-lib/include",
]
library_dirs = [
"/usr/lib",
"/usr/local/lib",
"/usr/lib64",
"/usr/local/lib64",
"/opt/lib",
"/opt/local/lib",
"/opt/homebrew/lib",
"/opt/homebrew/opt/ta-lib/lib",
]
elif sys.platform == "win32":
lib_talib_name = "ta_libc_cdr"
include_dirs = [
r"c:\ta-lib\c\include"
] # copy all .h files to c:\ta-lib\c\include\ta-lib\ directory
library_dirs = [r"C:\ProgramData\Anaconda3\Library\lib"] # change to your lib path
include_dirs.append(numpy.get_include())
ext_modules = [
Extension(
"ta_formula.indicators",
["ta_formula/indicators.pyx"],
include_dirs=include_dirs,
library_dirs=library_dirs,
libraries=[lib_talib_name],
runtime_library_dirs=[] if sys.platform == "win32" else library_dirs,
define_macros=[("NPY_NO_DEPRECATED_API", "NPY_1_7_API_VERSION")],
),
]
setup(ext_modules=ext_modules)