-
Notifications
You must be signed in to change notification settings - Fork 279
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
py3-grpcio-tools: python multiversioning (#34780)
- Loading branch information
Showing
3 changed files
with
94 additions
and
53 deletions.
There are no files selected for viewing
This file contains 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 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 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 |
---|---|---|
@@ -1,83 +1,126 @@ | ||
# Generated from https://pypi.org/project/grpcio-tools/ | ||
package: | ||
name: py3-grpcio-tools | ||
version: 1.67.1 | ||
epoch: 1 | ||
version: 1.68.0 | ||
epoch: 0 | ||
description: Protobuf code generator for gRPC | ||
copyright: | ||
- license: Apache-2.0 | ||
dependencies: | ||
runtime: | ||
- py3-protobuf | ||
- py3-grpcio | ||
- py3-setuptools | ||
- python3 | ||
provider-priority: 0 | ||
|
||
vars: | ||
pypi-package: grpcio-tools | ||
import: grpc_tools.protoc | ||
|
||
data: | ||
- name: py-versions | ||
items: | ||
3.10: '310' | ||
3.11: '311' | ||
3.12: '312' | ||
3.13: '300' | ||
|
||
environment: | ||
contents: | ||
packages: | ||
- build-base | ||
- busybox | ||
- ca-certificates-bundle | ||
- cython | ||
- git | ||
- openssf-compiler-options | ||
- py3-setuptools | ||
- py3-wheel | ||
- py3-supported-build-base | ||
- py3-supported-cython | ||
- py3-supported-python-dev | ||
- py3-supported-setuptools | ||
- python3 | ||
- python3-dev | ||
- wolfi-base | ||
environment: | ||
# https://github.com/wolfi-dev/os/issues/34075 | ||
GCC_SPEC_FILE: /dev/null | ||
GRPC_PYTHON_BUILD_WITH_CYTHON: 1 | ||
|
||
pipeline: | ||
- uses: git-checkout | ||
with: | ||
repository: https://github.com/grpc/grpc | ||
tag: v${{package.version}} | ||
expected-commit: d3286610f703a339149c3f9be69f0d7d0abb130a | ||
expected-commit: 6b49ae626bc9cd7033e062f89dbe0e0576b1110e | ||
|
||
- runs: | | ||
git submodule update --init | ||
cd tools/distrib/python/grpcio_tools | ||
python ../make_grpcio_tools.py | ||
export GRPC_PYTHON_BUILD_WITH_CYTHON=1 | ||
python setup.py install --prefix=/usr --root="${{targets.destdir}}" | ||
python3 ../make_grpcio_tools.py | ||
- uses: strip | ||
|
||
subpackages: | ||
- range: py-versions | ||
name: py${{range.key}}-${{vars.pypi-package}} | ||
description: python${{range.key}} version of ${{vars.pypi-package}} | ||
dependencies: | ||
provider-priority: ${{range.value}} | ||
provides: | ||
- py3-${{vars.pypi-package}} | ||
runtime: | ||
- py${{range.key}}-grpcio | ||
- py${{range.key}}-protobuf | ||
pipeline: | ||
- uses: py/pip-build-install | ||
with: | ||
python: python${{range.key}} | ||
working-directory: tools/distrib/python/grpcio_tools | ||
- uses: strip | ||
test: | ||
pipeline: | ||
- name: Verify Installation | ||
uses: python/import | ||
with: | ||
python: python${{range.key}} | ||
imports: | | ||
import ${{vars.import}} | ||
- name: Test Protobuf Compilation | ||
runs: | | ||
# Create a temporary directory for testing | ||
mkdir -p /home/build/test-grpcio-tools | ||
cd /home/build/test-grpcio-tools | ||
# Create a sample .proto file for testing | ||
echo 'syntax = "proto3"; package test; message TestMessage { string test_field = 1; }' > test.proto | ||
# Compile the .proto file using grpcio-tools | ||
python${{range.key}} -m grpc_tools.protoc -I. --python_out=. --grpc_python_out=. test.proto || exit 1 | ||
echo "Protobuf file compiled successfully." | ||
# Check if Python files were generated | ||
if [ ! -f test_pb2.py ] || [ ! -f test_pb2_grpc.py ]; then | ||
echo "Generated Python files not found!" | ||
exit 1 | ||
fi | ||
echo "Generated Python files found." | ||
- name: Clean Up | ||
runs: | | ||
# Clean up the test files after the test | ||
rm -rf /home/build/test-grpcio-tools | ||
- name: py3-supported-${{vars.pypi-package}} | ||
description: meta package providing ${{vars.pypi-package}} for supported python versions. | ||
dependencies: | ||
runtime: | ||
- py3.10-${{vars.pypi-package}} | ||
- py3.11-${{vars.pypi-package}} | ||
- py3.12-${{vars.pypi-package}} | ||
- py3.13-${{vars.pypi-package}} | ||
|
||
test: | ||
pipeline: | ||
- name: Verify Installation | ||
uses: python/import | ||
with: | ||
import: ${{vars.import}} | ||
|
||
update: | ||
enabled: true | ||
github: | ||
identifier: grpc/grpc | ||
strip-prefix: v | ||
use-tag: true | ||
|
||
test: | ||
pipeline: | ||
- name: Verify Installation | ||
runs: | | ||
# Ensure that grpcio-tools is installed | ||
python3 -c "import grpc_tools.protoc" || exit 1 | ||
echo "grpcio-tools package is installed." | ||
- name: Test Protobuf Compilation | ||
runs: | | ||
# Create a temporary directory for testing | ||
mkdir -p /home/build/test-grpcio-tools | ||
cd /home/build/test-grpcio-tools | ||
# Create a sample .proto file for testing | ||
echo 'syntax = "proto3"; package test; message TestMessage { string test_field = 1; }' > test.proto | ||
# Compile the .proto file using grpcio-tools | ||
python3 -m grpc_tools.protoc -I. --python_out=. --grpc_python_out=. test.proto || exit 1 | ||
echo "Protobuf file compiled successfully." | ||
# Check if Python files were generated | ||
if [ ! -f test_pb2.py ] || [ ! -f test_pb2_grpc.py ]; then | ||
echo "Generated Python files not found!" | ||
exit 1 | ||
fi | ||
echo "Generated Python files found." | ||
- name: Clean Up | ||
runs: | | ||
# Clean up the test files after the test | ||
rm -rf /home/build/test-grpcio-tools |