Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion PKG-INFO
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Metadata-Version: 2.1
Name: tqsdk
Version: 3.7.0
Version: 3.7.1
Summary: TianQin SDK
Home-page: https://www.shinnytech.com/tqsdk
Author: TianQin
Expand Down
4 changes: 2 additions & 2 deletions doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@
# built documents.
#
# The short X.Y version.
version = u'3.7.0'
version = u'3.7.1'
# The full version, including alpha/beta/rc tags.
release = u'3.7.0'
release = u'3.7.1'

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down
6 changes: 6 additions & 0 deletions doc/version.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

版本变更
=============================
3.7.1 (2024/08/29)

* 修复:在 Windows 系统上使用 :py:class:`~tqsdk.TqCtp` 账户导致多 TqApi 实例无法运行的问题
* 修复::py:class:`~tqsdk.TqCtp` 文档 demo 代码拼写错误


3.7.0 (2024/08/22)

* 新增::py:class:`~tqsdk.TqCtp` 账户类型,支持直连 CTP 柜台
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

setuptools.setup(
name='tqsdk',
version="3.7.0",
version="3.7.1",
description='TianQin SDK',
author='TianQin',
author_email='tianqincn@gmail.com',
Expand All @@ -18,7 +18,7 @@
packages=setuptools.find_packages(exclude=["tqsdk.test", "tqsdk.test.*"]),
python_requires='>=3.6.4',
install_requires=["websockets>=8.1", "requests", "numpy", "pandas>=1.1.0", "scipy", "simplejson", "aiohttp",
"certifi", "pyjwt", "psutil", "shinny_structlog", "sgqlc", "filelock", "tqsdk_ctpse", "tqsdk_sm", "tqsdk_zq_otg==1.1.0"],
"certifi", "pyjwt", "psutil", "shinny_structlog", "sgqlc", "filelock", "tqsdk_ctpse", "tqsdk_sm", "tqsdk_zq_otg==1.1.1"],
classifiers=[
"Programming Language :: Python :: 3",
"License :: OSI Approved :: Apache Software License",
Expand Down
2 changes: 1 addition & 1 deletion tqsdk/__version__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '3.7.0'
__version__ = '3.7.1'
2 changes: 1 addition & 1 deletion tqsdk/tradeable/otg/tqctp.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def __init__(self, account_id: str, password: str, front_broker: str, front_url:
Example1::

from tqsdk import TqApi, TqCtp
account = TqCtp(account_id="CTP 账户", password="CTP 密码", front_broker="CTP 柜台代码", "front_url"="CTP 柜台地址", app_id="CTP AppID", auth_code="CTP AuthCode")
account = TqCtp(account_id="CTP 账户", password="CTP 密码", front_broker="CTP 柜台代码", front_url="CTP 柜台地址", app_id="CTP AppID", auth_code="CTP AuthCode")
api = TqApi(account, auth=TqAuth("快期账户", "账户密码"))

"""
Expand Down
9 changes: 4 additions & 5 deletions tqsdk/zq_otg.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import subprocess
import contextlib
from pathlib import Path
from asyncio.subprocess import DEVNULL
from asyncio.subprocess import DEVNULL, PIPE

from tqsdk_zq_otg import get_zq_otg_path

Expand Down Expand Up @@ -46,9 +46,9 @@ async def get_addr(self):
self._zq_otg_proc.poll()
if self._zq_otg_proc is None or self._zq_otg_proc.returncode is not None:
if sys.platform.startswith("win"):
self._zq_otg_proc = subprocess.Popen([self._zq_otg_exe, f"--config={parameters}", "--mode=cmd"], stdin=DEVNULL, stdout=DEVNULL, stderr=DEVNULL, env=self._zq_otg_env)
self._zq_otg_proc = subprocess.Popen([self._zq_otg_exe, f"--config={parameters}", "--mode=cmd"], stdin=PIPE, stdout=DEVNULL, stderr=DEVNULL, env=self._zq_otg_env)
else:
self._zq_otg_proc = await asyncio.create_subprocess_exec(self._zq_otg_exe, f"--config={parameters}", "--mode=cmd", stdin=DEVNULL, stdout=DEVNULL, stderr=DEVNULL, env=self._zq_otg_env)
self._zq_otg_proc = await asyncio.create_subprocess_exec(self._zq_otg_exe, f"--config={parameters}", "--mode=cmd", stdin=PIPE, stdout=DEVNULL, stderr=DEVNULL, env=self._zq_otg_env)

for i in range(30):
if port_file.exists():
Expand All @@ -62,8 +62,7 @@ async def get_addr(self):

async def __aexit__(self, exc_type, exc, tb):
if self._zq_otg_proc is not None:
with contextlib.suppress(ProcessLookupError):
self._zq_otg_proc.send_signal(signal.CTRL_BREAK_EVENT if sys.platform.startswith("win") else signal.SIGTERM)
self._zq_otg_proc.stdin.close()
if sys.platform.startswith("win"):
self._zq_otg_proc.wait()
else:
Expand Down