Skip to content

Fix green-20220302 import without websocket helpers#44

Open
AndersonBY wants to merge 1 commit into
aliyun:masterfrom
AndersonBY:fix-green-20220302-websocket-import
Open

Fix green-20220302 import without websocket helpers#44
AndersonBY wants to merge 1 commit into
aliyun:masterfrom
AndersonBY:fix-green-20220302-websocket-import

Conversation

@AndersonBY

Copy link
Copy Markdown

Summary

  • delay websocket helper imports in green-20220302 so importing the package and non-websocket APIs does not fail when alibabacloud-tea-openapi lacks websocketUtils modules
  • keep MultiModalGuardWs websocket helper loading at the call/from_map site where it is actually needed
  • add a regression test covering package import with the current alibabacloud-tea-openapi dependency

Reproduction

With alibabacloud-green20220302 3.4.0 and alibabacloud-tea-openapi 0.4.4, this currently fails during import:

from alibabacloud_green20220302 import models
from alibabacloud_green20220302.client import Client

The failure is caused by generated MultiModalGuardWs code importing alibabacloud_tea_openapi.websocketUtils_models and alibabacloud_tea_openapi.websocketUtils at module import time. Those modules are not present in the currently released alibabacloud-tea-openapi 0.4.4 package.

This PR does not claim MultiModalGuardWs works without the websocket helper support. It only avoids breaking unrelated APIs such as TextModeration at import time.

Test

  • cd green-20220302 && /tmp/green-20220302-pr-venv/bin/python -m pytest tests/test_import.py -q
  • cd green-20220302 && /tmp/green-20220302-pr-venv/bin/python -m compileall -q alibabacloud_green20220302
  • git diff --check

@CLAassistant

CLAassistant commented Jun 30, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

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.

2 participants