-
Notifications
You must be signed in to change notification settings - Fork 16.1k
Extend gencode compatibility support back to 3.20.0 #22423
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 4 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
db5a8a9
Extend gencode compatibility support back to 3.20.0
mkruskal-google 53b86a1
Remove 30.x parameterization
mkruskal-google efd6942
Fix requirements install
mkruskal-google 8425481
Desynchronize upb/pure tests
mkruskal-google c5306b4
Update comment
mkruskal-google File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,79 @@ | ||
| #!/bin/bash | ||
|
|
||
| set -ex | ||
|
|
||
| PROTOC_VERSION=$1 | ||
| TEST_FILTER=$2 | ||
| PROTOC_DOWNLOAD=https://github.com/protocolbuffers/protobuf/releases/download/v$PROTOC_VERSION/protoc-$PROTOC_VERSION-linux-x86_64.zip | ||
| PY_SITE_PACKAGES=$(python -c 'import site; print(site.getsitepackages()[0])') | ||
|
|
||
| rm -rf protoc-old | ||
| mkdir protoc-old | ||
| pushd protoc-old | ||
| wget $PROTOC_DOWNLOAD | ||
| unzip *.zip | ||
| PROTOC=$(pwd)/bin/protoc | ||
| popd | ||
|
|
||
| # protoc prior to 28.0 doesn't support inf/nan option values. | ||
| sed -i 's/\(inf\|nan\)/0/g' src/google/protobuf/unittest_custom_options.proto | ||
|
|
||
| bazel build //python:copied_test_proto_files //python:copied_wkt_proto_files | ||
|
|
||
| COMPAT_COPIED_PROTOS=( | ||
| # Well-known types give good build coverage | ||
| any | ||
| api | ||
| duration | ||
| empty | ||
| field_mask | ||
| source_context | ||
| struct | ||
| timestamp | ||
| type | ||
| wrappers | ||
| # These protos are used in tests of custom options handling. | ||
| unittest_custom_options | ||
| unittest_import | ||
| ) | ||
|
|
||
| for proto in ${COMPAT_COPIED_PROTOS[@]}; do | ||
| $PROTOC --python_out=$PY_SITE_PACKAGES \ | ||
| bazel-bin/python/google/protobuf/$proto.proto \ | ||
| -Ibazel-bin/python | ||
| done | ||
|
|
||
| COMPAT_PROTOS=( | ||
| # All protos without transitive dependencies on edition 2023+. | ||
| descriptor_pool_test1 | ||
| descriptor_pool_test2 | ||
| factory_test1 | ||
| factory_test2 | ||
| file_options_test | ||
| import_test_package/import_public | ||
| import_test_package/import_public_nested | ||
| import_test_package/inner | ||
| import_test_package/outer | ||
| message_set_extensions | ||
| missing_enum_values | ||
| more_extensions | ||
| more_extensions_dynamic | ||
| more_messages | ||
| no_package | ||
| packed_field_test | ||
| test_bad_identifiers | ||
| test_proto2 | ||
| test_proto3_optional | ||
| ) | ||
|
|
||
| for proto in ${COMPAT_PROTOS[@]}; do | ||
| $PROTOC --python_out=$PY_SITE_PACKAGES \ | ||
| python/google/protobuf/internal/$proto.proto \ | ||
| -Ipython | ||
| done | ||
|
|
||
| # Exclude pybind11 tests because they require C++ code that doesn't ship with | ||
| # our test wheels. | ||
| TEST_EXCLUSIONS="_pybind11_test.py" | ||
| TESTS=$(pip show -f protobuftests | grep -i $TEST_FILTER | grep --invert-match $TEST_EXCLUSIONS | sed 's,/,.,g' | sed -E 's,.py$,,g') | ||
| python -m unittest -v ${TESTS[@]} |
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
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
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
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.