代码拉取完成,页面将自动刷新
同步操作将从 syealfalfa/CtpPlus-master 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
# encoding:utf-8
import sys
import os
import shutil
import platform
from setuptools import setup
from Cython.Build import cythonize, build_ext
from Cython.Distutils import Extension as Cython_Extension
arch = platform.architecture()
if arch[0] == "64bit":
myArch = "64"
elif arch[0] == "32bit":
myArch = "32"
else:
raise EnvironmentError("The architecture of platform is error.")
PRJ_NAME = "CtpPlus"
API_NAME = "CTP"
CUR_DIR = os.path.dirname(os.path.abspath(__file__))
PRJ_DIR = os.path.join(CUR_DIR, PRJ_NAME)
API_DIR = os.path.join(PRJ_DIR, API_NAME)
CTP_LIB = os.path.join(API_DIR, "api")
C2CYTHON_HEADER = os.path.join(API_DIR, "c2cython")
CYTHON2C_HEADER = os.path.join(API_DIR, "cython2c")
package_data = []
extra_link_args = None
extra_compile_args = None
l_myOS = platform.system()
if l_myOS == "Linux":
CTP_LIB = os.path.join(CTP_LIB, "linux" + myArch)
package_data.append('*.so')
extra_compile_args = ["-std=c++11"]
extra_link_args = ["-Wl,-rpath,$ORIGIN"]
elif l_myOS == "Windows":
CTP_LIB = os.path.join(CTP_LIB, "windows" + myArch)
package_data.append('*.dll')
extra_compile_args = ["/GR", "/EHsc"]
extra_link_args = []
else:
print("不支持的操作系统")
sys.exit(1)
common_args = {
"cython_include_dirs": [CYTHON2C_HEADER, C2CYTHON_HEADER],
"include_dirs": [CTP_LIB, C2CYTHON_HEADER],
"library_dirs": [CTP_LIB],
"language": "c++",
"extra_compile_args": extra_compile_args,
"extra_link_args": extra_link_args,
}
l_setup_ext_modules = cythonize([Cython_Extension(name="CtpPlus.CTP.MdApiBase",
sources=[os.path.join(API_DIR, "MdApiBase.pyx")],
language='c++',
include_dirs=common_args['include_dirs'],
library_dirs=common_args['library_dirs'],
libraries=["thostmduserapi_se"],
extra_compile_args=extra_compile_args,
extra_link_args=extra_link_args),
Cython_Extension(name="CtpPlus.CTP.TraderApiBase",
sources=[os.path.join(API_DIR, "TraderApiBase.pyx")],
language='c++',
include_dirs=common_args['include_dirs'],
library_dirs=common_args['library_dirs'],
libraries=["thosttraderapi_se"],
extra_compile_args=extra_compile_args,
extra_link_args=extra_link_args)
],
compiler_directives={'language_level': 3, "binding": True}
)
setup(
name=PRJ_NAME,
version="6.7.2",
author='jyl',
author_email='',
license="",
url='',
description='CTP官方API的封装的Python版。',
long_description='''
从以下三个不同的维度实现低延时:
1. 利用Cython技术释放了GIL;
2. 同时支持接入多路行情源,降低轮询等待时间;
3. 利用CTP的线程特性,以接口回调直接驱动策略运行,无需主事件引擎,真正实现去中心化。
''',
keywords="CTP程序化交易",
platforms=["Windows", "Linux"],
python_requires=">=3.7",
include_dirs=[CTP_LIB, CYTHON2C_HEADER],
packages=["CtpPlus", "CtpPlus.CTP", "CtpPlus.utils", "CtpPlus.ta", "CtpPlus.examples"],
ext_modules=l_setup_ext_modules,
package_data={"": package_data},
zip_safe=False,
)
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。