Skip to content

feature: use CommonClient to send requests - #128

Open
Mxiansen wants to merge 5 commits into
TencentCloud:masterfrom
Mxiansen:feature/use-CommonClient-to-send-requests
Open

feature: use CommonClient to send requests#128
Mxiansen wants to merge 5 commits into
TencentCloud:masterfrom
Mxiansen:feature/use-CommonClient-to-send-requests

Conversation

@Mxiansen

Copy link
Copy Markdown

Changes

  • Replace tencentcloud-sdk-python dependency with tencentcloud-sdk-python-common in setup.py, removing the hard dependency on the full Python SDK (which bundles all service models).
  • Add GenericActionCaller class in tccli/action_caller.py that uses CommonClient to send API requests uniformly, replacing per-service generated client calls.
  • Update ServiceCommand in tccli/command.py to use GenericActionCaller as the default action caller.
  • Refactor tccli/plugins/test/add.py to use CommonClient instead of importing the full CVM SDK client.
  • Add response filtering (_filter_response) that projects API responses against the api.json schema, dropping undefined fields.
  • Refactor test utilities (tests/utils.py): add shell(), shell_with_stderr(), and recover_profile() helpers.
  • Add new test files: test_action_caller.py, test_auth.py, test_configure.py, test_sso.py.
  • Simplify existing tests (test_cvm.py, test_helper.py) to use the new shell() utility.

- 新增 tccli/action_caller.py,实现 GenericActionCaller,基于 CommonClient 以 JSON 方式统一调用云 API(含凭证解析、版本选择、Waiter、按 api.json schema 过滤响应)
- tccli/command.py:未指定 action_caller 时默认使用 GenericActionCaller
- setup.py:依赖由 tencentcloud-sdk-python 切换为 tencentcloud-sdk-python-common
- tccli/plugins/test/add.py:示例插件改用 CommonClient 调用 CVM API
- tests:新增 test_action_caller/test_configure/test_auth/test_sso,更新 test_cvm/test_helper/utils(引入 shell/recover_profile 工具,保留 TestCli)
@Mxiansen Mxiansen changed the title feature: use CommonClient to send requests, remove hard dependency on full Python SDK feature: use CommonClient to send requests Jul 22, 2026
Mxiansen added 2 commits July 22, 2026 20:58
- command.py: 优先走各服务 *_client.py(存量行为),client.py 缺失时(二进制裁剪)降级到 GenericActionCaller
- setup.py: 依赖回退为完整 tencentcloud-sdk-python,保证 pip 存量用户行为不变
- 新增 .github/workflows/binary-release.yml: PyInstaller 打包前裁剪 *_client.py 并仅装 tencentcloud-sdk-python-common,二进制走 CommonClient 且体积更小
@Mxiansen
Mxiansen force-pushed the feature/use-CommonClient-to-send-requests branch from b5aecf2 to fad1810 Compare July 23, 2026 06:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant