Skip to content

Commit dc581df

Browse files
Update nipunn1313-mypy, nipunn1313-mypy-grpc, grpc-ecosystem, and grpc (#2402)
### nipunn1313-mypy - v4.0.0 → v5.0.0 ### nipunn1313-mypy-grpc - v4.0.0 → v5.0.0 ### grpc-ecosystem - openapiv2: v2.28.0 → v2.29.0 - gateway: v2.28.0 → v2.29.0 - registry.go.min_version bumped: 1.24 → 1.25 (required by [github.com/grpc-ecosystem/grpc-gateway/v2@v2.29.0 go.mod](https://proxy.golang.org/github.com/grpc-ecosystem/grpc-gateway/v2/@v/v2.29.0.mod)) ### grpc - swift-protobuf: v2.2.1 → v2.3.0
1 parent 9d1b291 commit dc581df

30 files changed

Lines changed: 1031 additions & 0 deletions

File tree

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
*
2+
!Dockerfile
3+
!requirements.txt
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# syntax=docker/dockerfile:1.23
2+
FROM python:3.13.13-trixie@sha256:65f8aa71dc4312ad477efc04f3756609e586204500d5d13ab85d38e6917c629f AS build
3+
WORKDIR /app
4+
RUN python -mvenv /app
5+
ADD /requirements.txt requirements.txt
6+
RUN . ./bin/activate \
7+
&& pip install --no-cache-dir -r requirements.txt \
8+
&& pip uninstall --yes pip setuptools \
9+
&& rm -f requirements.txt bin/activate.fish bin/activate.csh bin/Activate.ps1 \
10+
&& rm -f bin/protoc-gen-mypy \
11+
&& ln -sf /usr/bin/python /app/bin/python
12+
13+
FROM gcr.io/distroless/python3-debian13:latest@sha256:ed3a4beb46f8f8baac068743ba1b1f95ea3f793422129cf6dd23967f779b6018 AS base
14+
15+
FROM scratch
16+
COPY --link --from=base / /
17+
COPY --link --from=build /app /app
18+
USER nobody
19+
ENTRYPOINT [ "/app/bin/protoc-gen-mypy_grpc" ]
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
version: v1
2+
name: buf.build/community/nipunn1313-mypy-grpc
3+
plugin_version: v5.0.0
4+
source_url: https://github.com/nipunn1313/mypy-protobuf
5+
description: Generate mypy stub files for grpcio generated code.
6+
spdx_license_id: Apache-2.0
7+
license_url: https://github.com/nipunn1313/mypy-protobuf/blob/v5.0.0/LICENSE
8+
output_languages:
9+
- python
10+
registry:
11+
python:
12+
package_type: "stub-only"
13+
# https://github.com/nipunn1313/mypy-protobuf/blob/v5.0.0/setup.cfg#L20
14+
requires_python: ">=3.8"
15+
deps:
16+
# https://github.com/nipunn1313/mypy-protobuf/tree/v5.0.0#requirements-to-run-typecheckers-on-stubs-generated-by-mypy-protobuf
17+
# > Earlier releases might work, but aren't tested.
18+
- "types-protobuf >= 6.32"
19+
- "protobuf >= 6.32"
20+
# https://github.com/nipunn1313/mypy-protobuf/tree/v5.0.0#to-run-typecheckers-on-code-generated-with-grpc-plugin---youll-additionally-need
21+
# > Earlier releases might work, but aren't tested
22+
- "grpcio >= 1.70"
23+
# https://pypi.org/project/grpcio-tools/
24+
- "grpcio-tools >= 1.70"
25+
# https://pypi.org/project/types-grpcio/
26+
- "types-grpcio >= 1.0.0.20251009"
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
mypy-protobuf==5.0.0
2+
protobuf==6.33.1
3+
types-protobuf==6.32.1.20251105
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
*
2+
!Dockerfile
3+
!requirements.txt
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# syntax=docker/dockerfile:1.23
2+
FROM python:3.13.13-trixie@sha256:65f8aa71dc4312ad477efc04f3756609e586204500d5d13ab85d38e6917c629f AS build
3+
WORKDIR /app
4+
RUN python -mvenv /app
5+
ADD /requirements.txt requirements.txt
6+
RUN . ./bin/activate \
7+
&& pip install --no-cache-dir -r requirements.txt \
8+
&& pip uninstall --yes pip setuptools \
9+
&& rm -f requirements.txt bin/activate.fish bin/activate.csh bin/Activate.ps1 \
10+
&& rm -f bin/protoc-gen-mypy_grpc \
11+
&& ln -sf /usr/bin/python /app/bin/python
12+
13+
FROM gcr.io/distroless/python3-debian13:latest@sha256:ed3a4beb46f8f8baac068743ba1b1f95ea3f793422129cf6dd23967f779b6018 AS base
14+
15+
FROM scratch
16+
COPY --link --from=base / /
17+
COPY --link --from=build /app /app
18+
USER nobody
19+
ENTRYPOINT [ "/app/bin/protoc-gen-mypy" ]
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
version: v1
2+
name: buf.build/community/nipunn1313-mypy
3+
plugin_version: v5.0.0
4+
source_url: https://github.com/nipunn1313/mypy-protobuf
5+
description: Generate mypy stub files from Protobuf definitions.
6+
spdx_license_id: Apache-2.0
7+
license_url: https://github.com/nipunn1313/mypy-protobuf/blob/v5.0.0/LICENSE
8+
output_languages:
9+
- python
10+
registry:
11+
python:
12+
package_type: "stub-only"
13+
# https://github.com/nipunn1313/mypy-protobuf/blob/v5.0.0/pyproject.toml#L21
14+
requires_python: ">=3.8"
15+
deps:
16+
# https://github.com/nipunn1313/mypy-protobuf/tree/v5.0.0#requirements-to-run-typecheckers-on-stubs-generated-by-mypy-protobuf
17+
# > Earlier releases might work, but aren't tested.
18+
- "types-protobuf >= 6.32"
19+
- "protobuf >= 6.32"
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
mypy-protobuf==5.0.0
2+
protobuf==6.33.1
3+
types-protobuf==6.32.1.20251105
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
*
2+
!Dockerfile
3+
!separate_pkg_additional_imports.patch
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# syntax=docker/dockerfile:1.23
2+
FROM --platform=$BUILDPLATFORM golang:1.26.2-trixie@sha256:c0074c718b473f3827043f86532c4c0ff537e3fe7a81b8219b0d1ccfcc2c9a09 AS build
3+
4+
ARG TARGETOS TARGETARCH
5+
ENV CGO_ENABLED=0 GOOS=$TARGETOS GOARCH=$TARGETARCH
6+
7+
WORKDIR /tmp
8+
RUN git clone --depth 1 --branch v2.29.0 https://github.com/grpc-ecosystem/grpc-gateway.git
9+
COPY --link separate_pkg_additional_imports.patch /tmp/separate_pkg_additional_imports.patch
10+
WORKDIR /tmp/grpc-gateway
11+
RUN git apply /tmp/separate_pkg_additional_imports.patch
12+
RUN --mount=type=cache,target=/go/pkg/mod \
13+
GOOS= GOARCH= go test -run 'TestGenerator_GenerateSeparatePackage' ./protoc-gen-grpc-gateway/internal/gengateway/
14+
WORKDIR /tmp/grpc-gateway/protoc-gen-grpc-gateway
15+
RUN --mount=type=cache,target=/go/pkg/mod \
16+
go install -ldflags="-s -w" -trimpath \
17+
&& mv /go/bin/${GOOS}_${GOARCH}/protoc-gen-grpc-gateway /go/bin/protoc-gen-grpc-gateway || true
18+
19+
FROM scratch
20+
COPY --from=build --link --chown=root:root /etc/passwd /etc/passwd
21+
COPY --from=build --link --chown=root:root /go/bin/protoc-gen-grpc-gateway /
22+
USER nobody
23+
ENTRYPOINT [ "/protoc-gen-grpc-gateway" ]

0 commit comments

Comments
 (0)