-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
65 lines (59 loc) · 2.04 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
import platform
import ast
import re
from setuptools import Extension, find_packages, setup
with open("vnpy/__init__.py", "rb") as f:
version_line = re.search(
r"__version__\s+=\s+(.*)", f.read().decode("utf-8")
).group(1)
version = str(ast.literal_eval(version_line))
if platform.uname().system == "Windows":
compiler_flags = []
else:
compiler_flags = ["-std=c++11", "-Wno-delete-incomplete"]
vnctpmd = Extension("vnpy.api.ctp.vnctpmd",
[
"vnpy/api/ctp/vnctp/vnctpmd/vnctpmd.cpp",
],
include_dirs=["vnpy/api/ctp/include", "vnpy/api/ctp/vnctp", ],
define_macros=[],
undef_macros=[],
library_dirs=["vnpy/api/ctp/libs"],
libraries=["thostmduserapi", "thosttraderapi", ],
extra_compile_args=compiler_flags,
extra_link_args=[],
depends=[],
language="cpp",
)
vnctptd = Extension("vnpy.api.ctp.vnctptd",
[
"vnpy/api/ctp/vnctp/vnctptd/vnctptd.cpp",
],
include_dirs=["vnpy/api/ctp/include", "vnpy/api/ctp/vnctp", ],
define_macros=[],
undef_macros=[],
library_dirs=["vnpy/api/ctp/libs"],
libraries=["thostmduserapi", "thosttraderapi", ],
extra_compile_args=compiler_flags,
extra_link_args=[],
depends=[],
language="cpp",
)
# use built in pyd for windows
if platform.uname().system == "Windows":
ext_modules = []
else:
ext_modules = [vnctptd, vnctpmd],
pkgs = find_packages()
s = setup(
name="vnpy",
version=version,
include_package_data=True,
packages=pkgs,
package_data={"": [
"*.json", "*.md", "*.ico",
"*.dll", "*.so", "*.pyd"
]},
install_requires=[],
ext_modules=ext_modules
)