Repository navigation
Conversation
The dependency constraint was protobuf>=5.29.4,<7, and the proto package routed only major == 6 to the 6.x gencode, raising ValueError for anything newer. An environment that already has protobuf 7 could not resolve the SDK at all. protobuf's runtime check (runtime_version.ValidateProtobufRuntimeVersion) only rejects a runtime that is older than the gencode it loads, so the 6.x modules work unchanged on 7.x. Widen the constraint to <8 and route every major >= 6 to the v6 modules. The full suite passes under both protobuf 6.31.1 (867) and 7.36.2 (867) with no new warnings. tests/proto_test.py reloads xai_sdk.proto under patched runtime versions: 7.0.0, 7.36.0 and 8.1.0 select v6 (fail on main), 6.x and 5.x keep their modules, 4.x is still rejected.
Collaborator
|
This has been addressed by #223 and is fixed in versions |
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.
What
pyproject.tomlpinsprotobuf>=5.29.4,<7, andsrc/xai_sdk/proto/__init__.pyroutes onlymajor == 6to the 6.x generated modules, raisingValueError("Unsupported protobuf version")for anything newer. An environment that already has protobuf 7 cannot resolve the SDK at all; the resolver stops at the pin before any code runs.Why the 6.x gencode is enough
protobuf's runtime check (
google.protobuf.runtime_version.ValidateProtobufRuntimeVersion, 7.36.2) refuses two things: a gencode/runtime domain mismatch, and a runtime that is older than the gencode it loads. A newer runtime loading older gencode is the supported direction, so the modules generated with 6.30.0 import on 7.x without a warning. No regenerated stubs are needed.Change
protobuf>=5.29.4,<8inpyproject.toml(and the matchingrequires-distline inuv.lock; the resolved dev version is unchanged)._PROTOBUF_MAJOR >= 6selects the v6 modules;== 5and theValueErrorfor older runtimes are unchanged.Verification
uv pip install -e . 'protobuf>=7,<8'): 867 passed, and-W error::UserWarningstays green, so the 7.x runtime emits no gencode warnings for the v6 modules.tests/proto_test.pyreloadsxai_sdk.protowith the runtime version patched:7.0.0,7.36.0and8.1.0select v6 (these three fail onmainwith theValueError),6.31.1selects v6,5.29.4selects v5,4.25.0is still rejected.ruff check,ruff format --check,pyrightclean.#224 carries the same two-line change as its first commit (cherry-picked from #183). If this one lands first I drop that commit from #224; if #224 lands first this PR reduces to the test file and the CHANGELOG line.