Unify protobuf codegen with uv.lock at uv sync#38
Closed
Owen-Liuyuxuan wants to merge 4 commits into
Closed
Conversation
Co-authored-by: Cursor <cursoragent@cursor.com>
uv sync builds sync-tooling-msgs in an isolated environment before pytest, which could generate *_pb2.py with a newer protoc than the locked runtime (6.33.5 gencode vs 6.33.4 runtime). Apply build-constraint-dependencies so editable installs use the same pins as uv build -b. Co-authored-by: Cursor <cursoragent@cursor.com>
uv lock revision 3 captures workspace build constraints so uv sync installs sync-tooling-msgs with the same protobuf pins as uv build -b. Co-authored-by: Cursor <cursoragent@cursor.com>
6 tasks
Document why build-constraint-dependencies must stay aligned with uv.lock when bumping protobuf, and note the same pins in export_build_constraints.sh. Co-authored-by: Cursor <cursoragent@cursor.com>
|
Collaborator
|
Hey @Owen-Liuyuxuan, thank you for the investigation and fix work, much appreciated!
Please let me know what you think! |
Contributor
Author
|
@mojomex Because in the pytest you design,
The problem of protobuf error happens before |
Contributor
Author
|
@mojomex Close this for you PR |
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.




Summary
uv build:uv synceditable-installssync-tooling-msgsand runs Hatch protobuf codegen in a PEP 517 isolated environment, which could resolve newerprotobufthan the locked runtime in.venv.[tool.uv] build-constraint-dependenciesso everyuv syncbuild uses the same pins asuv.lock(protobuf, hatch-protobuf, mypy-protobuf, types-protobuf).scripts/export_build_constraints.sh+uv build -bfor release wheels (build-constraint-dependenciesdoes not apply to standaloneuv buildper uv#18283).uv buildonly).Test plan
uv sync --all-extras --dev --all-packagesthen importsync_tooling_msgs.clock_id_pb2uv run pytest sync_tooling_msgs/testsbuild.yamlgreen (pytest + build)