Skip to content

Commit 0545445

Browse files
committed
Merge branch 'fix_setup' into 'master'
fix: v3.5.7 — fix build-backend compatibility and lazy-load push command See merge request server/openapi/openapi-python-sdk!274
2 parents 1d8a3f9 + b9368b8 commit 0545445

13 files changed

Lines changed: 25 additions & 3637 deletions

File tree

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
## 3.5.7 (2026-03-25)
2+
### Fix
3+
- 修复 pyproject.toml 中 build-backend 使用 `setuptools.backends._legacy:_Backend` 导致旧版 pip/setuptools 安装失败的问题,改为标准的 `setuptools.build_meta`
4+
- 修复 CLI 启动时无条件导入 push 模块导致 protobuf 版本不兼容时所有命令都无法使用的问题,改为延迟加载 push 命令,protobuf 版本过低时给出升级提示
5+
16
## 3.5.6 (2026-03-24)
27
### New
38
- 新增 CLI 命令行工具 `tigeropen`,支持行情查询、交易管理、账户查看、实时推送等功能,输出格式支持 table/json/csv. 支持一键安装

pyproject.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[build-system]
22
requires = ["setuptools>=64", "wheel"]
3-
build-backend = "setuptools.backends._legacy:_Backend"
3+
build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "tigeropen"
@@ -47,7 +47,6 @@ dependencies = [
4747
"backoff",
4848
"jproperties",
4949
"protobuf",
50-
"google-cloud",
5150
"urllib3",
5251
"click>=8.0",
5352
]

tigeropen/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@
44
55
@author: gaoan
66
"""
7-
__VERSION__ = '3.5.6'
7+
__VERSION__ = '3.5.7'

tigeropen/cli/main.py

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
from tigeropen.cli.quote_cmd import quote
1414
from tigeropen.cli.trade_cmd import trade
1515
from tigeropen.cli.account_cmd import account
16-
from tigeropen.cli.push_cmd import push
1716

1817
CONTEXT_SETTINGS = dict(help_option_names=['-h', '--help'])
1918

@@ -170,7 +169,24 @@ def uninstall(remove_config, yes):
170169
cli.add_command(quote)
171170
cli.add_command(trade)
172171
cli.add_command(account)
173-
cli.add_command(push)
172+
173+
174+
def _load_push_command():
175+
"""Lazy-load push command to avoid importing protobuf at startup."""
176+
try:
177+
from tigeropen.cli.push_cmd import push
178+
cli.add_command(push)
179+
except ImportError:
180+
@cli.command('push')
181+
@click.argument('args', nargs=-1)
182+
def push_unavailable(args):
183+
"""Real-time data streaming (requires protobuf>=5.28)."""
184+
click.echo('Error: push command requires protobuf>=5.28.\n'
185+
'Please upgrade: pip install --upgrade protobuf')
186+
sys.exit(1)
187+
188+
189+
_load_push_command()
174190

175191

176192
def main():

tigeropen/examples/ai/skills/README.md

Lines changed: 0 additions & 259 deletions
This file was deleted.

0 commit comments

Comments
 (0)