Skip to content
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

py3-grpcio-gcp: Add python multiversion support #34721

Merged
merged 3 commits into from
Nov 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion pipelines/py/pip-build-install.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
name: Build and install python package with pip

inputs:
Expand All @@ -7,6 +7,9 @@
dest:
description: the destination
default: ${{targets.contextdir}}
source:
description: directory containing the python package source
default: .
needs-exe-named-python3:
description: Does the build actually need 'python3' in its PATH
default: false
Expand Down Expand Up @@ -107,7 +110,7 @@
mkdir -p "$distwheelsd"
echo "$py is $pyver with site_packages dir '$sitepkgd'"
vr $py -m pip wheel --verbose "--wheel-dir=$wd" \
"--find-links=$distwheelsd" --no-index --no-build-isolation --no-deps .
"--find-links=$distwheelsd" --no-index --no-build-isolation --no-deps "${{inputs.source}}"
vr $py -m pip install --verbose \
"--find-links=$distwheelsd" --no-index --no-build-isolation --no-deps \
--force-reinstall --no-compile --prefix=/usr "--root=$root" "$wd"/*.whl
Expand Down
88 changes: 70 additions & 18 deletions py3-grpcio-gcp.yaml
Original file line number Diff line number Diff line change
@@ -1,38 +1,90 @@
# Generated from https://pypi.org/project/grpcio-gcp/
package:
name: py3-grpcio-gcp
version: 0.2.2
epoch: 2
epoch: 3
description: gRPC extensions for Google Cloud Platform
copyright:
- license: Apache-2.0
dependencies:
runtime:
- py3-grpcio
- python-3
provider-priority: 0

vars:
pypi-package: grpcio-gcp
import: grpc_gcp

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
- py3-setuptools
- python-3
- wolfi-base
- py3-grpcio-tools
- py3-supported-build-base
- py3-supported-setuptools

pipeline:
- uses: fetch
- uses: git-checkout
with:
expected-sha256: e292605effc7da39b7a8734c719afb12ec4b5362add3528d8afad3aa3aa9057c
uri: https://files.pythonhosted.org/packages/source/g/grpcio-gcp/grpcio-gcp-${{package.version}}.tar.gz
repository: https://github.com/GoogleCloudPlatform/grpc-gcp-python
tag: v${{package.version}}
expected-commit: 8ef890243664ebd95ae0225cdf87e7442b570f9e

- name: Python Build
uses: python/build-wheel
- runs: |
cd src
# From src/setup.sh
cp -f ../template/version.py version.py
python3 -m grpc_tools.protoc -I. --python_out=grpc_gcp/proto grpc_gcp.proto
dannf marked this conversation as resolved.
Show resolved Hide resolved

- 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}}
source: ./src
dannf marked this conversation as resolved.
Show resolved Hide resolved
- uses: strip
test:
pipeline:
- uses: python/import
with:
python: python${{range.key}}
imports: |
import ${{vars.import}}

- 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:
- uses: python/import
with:
imports: |
import ${{vars.import}}

update:
enabled: true
release-monitor:
identifier: 100779
github:
identifier: GoogleCloudPlatform/grpc-gcp-python
strip-prefix: v
Loading