Repository navigation
fix: declare sniffio as a direct runtime dependency - #111
Open
JunkaiWang-TheoPhy wants to merge 1 commit into
Open
JunkaiWang-TheoPhy wants to merge 1 commit into
JunkaiWang-TheoPhy wants to merge 1 commit into
Conversation
The SDK already imports sniffio directly, but current httpx/anyio dependencies no longer supply it transitively. Declare the existing runtime requirement and verify real wheel installation without development extras. Confidence: high Scope-risk: narrow Tested: Original clean wheel fails both smoke tests; fixed wheel passes on Python 3.14 and 3.10 with Pydantic 1 and 2 Not-tested: Full upstream test suites and live API requests
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fixes #110.
Fresh SDK installations can fail before the first API call:
from zhipuai import ZhipuAIraisesModuleNotFoundError: No module named 'sniffio'. The SDK imports sniffio directly incore/_utils/_utils.pybut does not declare it as a runtime dependency. Environments using current httpx/anyio releases no longer receive it transitively.Declare the already-used sniffio dependency explicitly. Add installed-package smoke checks that import and close the public client and exercise async-library detection. They use only the standard library and runtime dependencies, run with
python -Iagainst an installed wheel, and perform no API requests. The accompanying instructions keep development extras out of that environment so they cannot conceal missing runtime dependencies.Validation
Built the original and fixed wheels and installed each with normal dependency resolution in separate, fresh Python3.14.6 environments. Both resolve httpx0.28.1, anyio4.15.1 and Pydantic2.14.2; the fixed wheel additionally installs sniffio1.3.1.
Both original-wheel errors identify missing sniffio. The fixed wheel also passes the same two checks on Python3.10.20 with Pydantic2.14.2 and Pydantic1.10.27. Wheel dependency consistency, Ruff checks/formatting of the new test, and
git diff --checkpass.The full upstream unit/integration suites and live API calls were not run. This change leaves SDK request, parsing, compatibility and authentication code unchanged. It is independent of the historical Python3.14/Pydantic-v1 warning in #107 and the PyJWT work in #109.
AI assistance: investigated, implemented and verified with OpenAI Codex assistance.