From 7f8998ea8753001798561ec39736a944a74c5a89 Mon Sep 17 00:00:00 2001 From: "Philip K. Warren" Date: Tue, 18 Nov 2025 10:50:34 -0600 Subject: [PATCH 1/4] Update nipunn1313-mypy plugins to the latest Update plugins to use bookworm based build image and distroless base image. Fixes #2104. --- .../nipunn1313-mypy-grpc/v3.7.0/.dockerignore | 3 +++ .../nipunn1313-mypy-grpc/v3.7.0/Dockerfile | 19 ++++++++++++++ .../v3.7.0/buf.plugin.yaml | 26 +++++++++++++++++++ .../v3.7.0/requirements.txt | 3 +++ .../nipunn1313-mypy/v3.7.0/.dockerignore | 3 +++ .../nipunn1313-mypy/v3.7.0/Dockerfile | 19 ++++++++++++++ .../nipunn1313-mypy/v3.7.0/buf.plugin.yaml | 19 ++++++++++++++ .../nipunn1313-mypy/v3.7.0/requirements.txt | 3 +++ .../v3.7.0/eliza/plugin.sum | 1 + .../v3.7.0/petapis/plugin.sum | 1 + .../nipunn1313-mypy/v3.7.0/eliza/plugin.sum | 1 + .../nipunn1313-mypy/v3.7.0/petapis/plugin.sum | 1 + 12 files changed, 99 insertions(+) create mode 100644 plugins/community/nipunn1313-mypy-grpc/v3.7.0/.dockerignore create mode 100644 plugins/community/nipunn1313-mypy-grpc/v3.7.0/Dockerfile create mode 100644 plugins/community/nipunn1313-mypy-grpc/v3.7.0/buf.plugin.yaml create mode 100644 plugins/community/nipunn1313-mypy-grpc/v3.7.0/requirements.txt create mode 100644 plugins/community/nipunn1313-mypy/v3.7.0/.dockerignore create mode 100644 plugins/community/nipunn1313-mypy/v3.7.0/Dockerfile create mode 100644 plugins/community/nipunn1313-mypy/v3.7.0/buf.plugin.yaml create mode 100644 plugins/community/nipunn1313-mypy/v3.7.0/requirements.txt create mode 100644 tests/testdata/buf.build/community/nipunn1313-mypy-grpc/v3.7.0/eliza/plugin.sum create mode 100644 tests/testdata/buf.build/community/nipunn1313-mypy-grpc/v3.7.0/petapis/plugin.sum create mode 100644 tests/testdata/buf.build/community/nipunn1313-mypy/v3.7.0/eliza/plugin.sum create mode 100644 tests/testdata/buf.build/community/nipunn1313-mypy/v3.7.0/petapis/plugin.sum diff --git a/plugins/community/nipunn1313-mypy-grpc/v3.7.0/.dockerignore b/plugins/community/nipunn1313-mypy-grpc/v3.7.0/.dockerignore new file mode 100644 index 000000000..c8a679bc6 --- /dev/null +++ b/plugins/community/nipunn1313-mypy-grpc/v3.7.0/.dockerignore @@ -0,0 +1,3 @@ +* +!Dockerfile +!requirements.txt diff --git a/plugins/community/nipunn1313-mypy-grpc/v3.7.0/Dockerfile b/plugins/community/nipunn1313-mypy-grpc/v3.7.0/Dockerfile new file mode 100644 index 000000000..7bb761af4 --- /dev/null +++ b/plugins/community/nipunn1313-mypy-grpc/v3.7.0/Dockerfile @@ -0,0 +1,19 @@ +# syntax=docker/dockerfile:1.19 +FROM python:3.11.13-bookworm AS build +WORKDIR /app +RUN python -mvenv /app +ADD /requirements.txt requirements.txt +RUN . ./bin/activate \ + && pip install --no-cache-dir -r requirements.txt \ + && pip uninstall --yes pip setuptools \ + && rm -f requirements.txt bin/activate.fish bin/activate.csh bin/Activate.ps1 \ + && rm -f bin/protoc-gen-mypy \ + && ln -sf /usr/bin/python /app/bin/python + +FROM gcr.io/distroless/python3-debian12:latest@sha256:afdfc6df9eb96cf65576d4d59af48c4b5dac29ad62066aee879f12b303298aac AS base + +FROM scratch +COPY --link --from=base / / +COPY --link --from=build /app /app +USER nobody +ENTRYPOINT [ "/app/bin/protoc-gen-mypy_grpc" ] diff --git a/plugins/community/nipunn1313-mypy-grpc/v3.7.0/buf.plugin.yaml b/plugins/community/nipunn1313-mypy-grpc/v3.7.0/buf.plugin.yaml new file mode 100644 index 000000000..603da9fbd --- /dev/null +++ b/plugins/community/nipunn1313-mypy-grpc/v3.7.0/buf.plugin.yaml @@ -0,0 +1,26 @@ +version: v1 +name: buf.build/community/nipunn1313-mypy-grpc +plugin_version: v3.7.0 +source_url: https://github.com/nipunn1313/mypy-protobuf +description: Generate mypy stub files for grpcio generated code. +spdx_license_id: Apache-2.0 +license_url: https://github.com/nipunn1313/mypy-protobuf/blob/v3.7.0/LICENSE +output_languages: + - python +registry: + python: + package_type: "stub-only" + # https://github.com/nipunn1313/mypy-protobuf/blob/v3.7.0/setup.cfg#L20 + requires_python: ">=3.8" + deps: + # https://github.com/nipunn1313/mypy-protobuf/tree/v3.7.0#requirements-to-run-typecheckers-on-stubs-generated-by-mypy-protobuf + # > Earlier releases might work, but aren't tested. + - "types-protobuf >= 5.28" + - "protobuf >= 5.28.2" + # https://github.com/nipunn1313/mypy-protobuf/tree/v3.7.0#to-run-typecheckers-on-code-generated-with-grpc-plugin---youll-additionally-need + # > Earlier releases might work, but aren't tested + - "grpcio >= 1.66.2" + # https://pypi.org/project/grpcio-tools/ + - "grpcio-tools >= 1.66.2" + # https://pypi.org/project/grpc-stubs/ + - "grpc-stubs >= 1.53.0.5" diff --git a/plugins/community/nipunn1313-mypy-grpc/v3.7.0/requirements.txt b/plugins/community/nipunn1313-mypy-grpc/v3.7.0/requirements.txt new file mode 100644 index 000000000..596407fc4 --- /dev/null +++ b/plugins/community/nipunn1313-mypy-grpc/v3.7.0/requirements.txt @@ -0,0 +1,3 @@ +mypy-protobuf==3.6.0 +protobuf==4.25.3 +types-protobuf==4.25.0.20240417 diff --git a/plugins/community/nipunn1313-mypy/v3.7.0/.dockerignore b/plugins/community/nipunn1313-mypy/v3.7.0/.dockerignore new file mode 100644 index 000000000..c8a679bc6 --- /dev/null +++ b/plugins/community/nipunn1313-mypy/v3.7.0/.dockerignore @@ -0,0 +1,3 @@ +* +!Dockerfile +!requirements.txt diff --git a/plugins/community/nipunn1313-mypy/v3.7.0/Dockerfile b/plugins/community/nipunn1313-mypy/v3.7.0/Dockerfile new file mode 100644 index 000000000..45fcdf103 --- /dev/null +++ b/plugins/community/nipunn1313-mypy/v3.7.0/Dockerfile @@ -0,0 +1,19 @@ +# syntax=docker/dockerfile:1.19 +FROM python:3.11.13-bookworm AS build +WORKDIR /app +RUN python -mvenv /app +ADD /requirements.txt requirements.txt +RUN . ./bin/activate \ + && pip install --no-cache-dir -r requirements.txt \ + && pip uninstall --yes pip setuptools \ + && rm -f requirements.txt bin/activate.fish bin/activate.csh bin/Activate.ps1 \ + && rm -f bin/protoc-gen-mypy_grpc \ + && ln -sf /usr/bin/python /app/bin/python + +FROM gcr.io/distroless/python3-debian12:latest@sha256:afdfc6df9eb96cf65576d4d59af48c4b5dac29ad62066aee879f12b303298aac AS base + +FROM scratch +COPY --link --from=base / / +COPY --link --from=build /app /app +USER nobody +ENTRYPOINT [ "/app/bin/protoc-gen-mypy" ] diff --git a/plugins/community/nipunn1313-mypy/v3.7.0/buf.plugin.yaml b/plugins/community/nipunn1313-mypy/v3.7.0/buf.plugin.yaml new file mode 100644 index 000000000..7aea8a80e --- /dev/null +++ b/plugins/community/nipunn1313-mypy/v3.7.0/buf.plugin.yaml @@ -0,0 +1,19 @@ +version: v1 +name: buf.build/community/nipunn1313-mypy +plugin_version: v3.7.0 +source_url: https://github.com/nipunn1313/mypy-protobuf +description: Generate mypy stub files from Protobuf definitions. +spdx_license_id: Apache-2.0 +license_url: https://github.com/nipunn1313/mypy-protobuf/blob/v3.7.0/LICENSE +output_languages: + - python +registry: + python: + package_type: "stub-only" + # https://github.com/nipunn1313/mypy-protobuf/blob/v3.7.0/setup.cfg#L20 + requires_python: ">=3.8" + deps: + # https://github.com/nipunn1313/mypy-protobuf/tree/v3.7.0#requirements-to-run-typecheckers-on-stubs-generated-by-mypy-protobuf + # > Earlier releases might work, but aren't tested. + - "types-protobuf >= 5.28" + - "protobuf >= 5.28.2" diff --git a/plugins/community/nipunn1313-mypy/v3.7.0/requirements.txt b/plugins/community/nipunn1313-mypy/v3.7.0/requirements.txt new file mode 100644 index 000000000..596407fc4 --- /dev/null +++ b/plugins/community/nipunn1313-mypy/v3.7.0/requirements.txt @@ -0,0 +1,3 @@ +mypy-protobuf==3.6.0 +protobuf==4.25.3 +types-protobuf==4.25.0.20240417 diff --git a/tests/testdata/buf.build/community/nipunn1313-mypy-grpc/v3.7.0/eliza/plugin.sum b/tests/testdata/buf.build/community/nipunn1313-mypy-grpc/v3.7.0/eliza/plugin.sum new file mode 100644 index 000000000..ca6015057 --- /dev/null +++ b/tests/testdata/buf.build/community/nipunn1313-mypy-grpc/v3.7.0/eliza/plugin.sum @@ -0,0 +1 @@ +h1:4bUMtQiZjyMK6koH4l8Nwlh8esWFITGE+bEvpS+M648= diff --git a/tests/testdata/buf.build/community/nipunn1313-mypy-grpc/v3.7.0/petapis/plugin.sum b/tests/testdata/buf.build/community/nipunn1313-mypy-grpc/v3.7.0/petapis/plugin.sum new file mode 100644 index 000000000..c956a8ef1 --- /dev/null +++ b/tests/testdata/buf.build/community/nipunn1313-mypy-grpc/v3.7.0/petapis/plugin.sum @@ -0,0 +1 @@ +h1:CbIkuxYDMR68hCz7p9XlfwLmdc+/9DGwppiWKqGB/QM= diff --git a/tests/testdata/buf.build/community/nipunn1313-mypy/v3.7.0/eliza/plugin.sum b/tests/testdata/buf.build/community/nipunn1313-mypy/v3.7.0/eliza/plugin.sum new file mode 100644 index 000000000..08d7f893e --- /dev/null +++ b/tests/testdata/buf.build/community/nipunn1313-mypy/v3.7.0/eliza/plugin.sum @@ -0,0 +1 @@ +h1:CtqY1NxS2gk2bFv8PBz8mQk3GjupMDtX3/EtkwqrA98= diff --git a/tests/testdata/buf.build/community/nipunn1313-mypy/v3.7.0/petapis/plugin.sum b/tests/testdata/buf.build/community/nipunn1313-mypy/v3.7.0/petapis/plugin.sum new file mode 100644 index 000000000..1a1b88e22 --- /dev/null +++ b/tests/testdata/buf.build/community/nipunn1313-mypy/v3.7.0/petapis/plugin.sum @@ -0,0 +1 @@ +h1:4c+oVRabFfrSibgCEGpwDD16HNW95a20Oha5NXhzrfM= From d694868ae9f014dc2fc646fa660f1dadbd052dda Mon Sep 17 00:00:00 2001 From: "Philip K. Warren" Date: Tue, 18 Nov 2025 10:54:53 -0600 Subject: [PATCH 2/4] Update dependencies in requirements.txt --- .../community/nipunn1313-mypy-grpc/v3.7.0/requirements.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/community/nipunn1313-mypy-grpc/v3.7.0/requirements.txt b/plugins/community/nipunn1313-mypy-grpc/v3.7.0/requirements.txt index 596407fc4..996325e6c 100644 --- a/plugins/community/nipunn1313-mypy-grpc/v3.7.0/requirements.txt +++ b/plugins/community/nipunn1313-mypy-grpc/v3.7.0/requirements.txt @@ -1,3 +1,3 @@ -mypy-protobuf==3.6.0 -protobuf==4.25.3 -types-protobuf==4.25.0.20240417 +mypy-protobuf==3.7.0 +protobuf==6.33.1 +types-protobuf==6.32.1.20251105 From ee4e2a58109af2853114131634c89ed5f01976db Mon Sep 17 00:00:00 2001 From: "Philip K. Warren" Date: Tue, 18 Nov 2025 10:55:11 -0600 Subject: [PATCH 3/4] Update requirements.txt --- plugins/community/nipunn1313-mypy/v3.7.0/requirements.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/community/nipunn1313-mypy/v3.7.0/requirements.txt b/plugins/community/nipunn1313-mypy/v3.7.0/requirements.txt index 596407fc4..996325e6c 100644 --- a/plugins/community/nipunn1313-mypy/v3.7.0/requirements.txt +++ b/plugins/community/nipunn1313-mypy/v3.7.0/requirements.txt @@ -1,3 +1,3 @@ -mypy-protobuf==3.6.0 -protobuf==4.25.3 -types-protobuf==4.25.0.20240417 +mypy-protobuf==3.7.0 +protobuf==6.33.1 +types-protobuf==6.32.1.20251105 From a28ba716a54ea8b61465674b767fa25be4d5ac50 Mon Sep 17 00:00:00 2001 From: "Philip K. Warren" Date: Tue, 18 Nov 2025 11:00:19 -0600 Subject: [PATCH 4/4] Rebuild plugin.sum files --- .../community/nipunn1313-mypy-grpc/v3.7.0/eliza/plugin.sum | 2 +- .../community/nipunn1313-mypy-grpc/v3.7.0/petapis/plugin.sum | 2 +- .../buf.build/community/nipunn1313-mypy/v3.7.0/eliza/plugin.sum | 2 +- .../community/nipunn1313-mypy/v3.7.0/petapis/plugin.sum | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/testdata/buf.build/community/nipunn1313-mypy-grpc/v3.7.0/eliza/plugin.sum b/tests/testdata/buf.build/community/nipunn1313-mypy-grpc/v3.7.0/eliza/plugin.sum index ca6015057..1136966ab 100644 --- a/tests/testdata/buf.build/community/nipunn1313-mypy-grpc/v3.7.0/eliza/plugin.sum +++ b/tests/testdata/buf.build/community/nipunn1313-mypy-grpc/v3.7.0/eliza/plugin.sum @@ -1 +1 @@ -h1:4bUMtQiZjyMK6koH4l8Nwlh8esWFITGE+bEvpS+M648= +h1:BYBWcreiMNyJTziSDWALko0+It2W4rJ10gW7o7SFwt0= diff --git a/tests/testdata/buf.build/community/nipunn1313-mypy-grpc/v3.7.0/petapis/plugin.sum b/tests/testdata/buf.build/community/nipunn1313-mypy-grpc/v3.7.0/petapis/plugin.sum index c956a8ef1..f8a53f8c1 100644 --- a/tests/testdata/buf.build/community/nipunn1313-mypy-grpc/v3.7.0/petapis/plugin.sum +++ b/tests/testdata/buf.build/community/nipunn1313-mypy-grpc/v3.7.0/petapis/plugin.sum @@ -1 +1 @@ -h1:CbIkuxYDMR68hCz7p9XlfwLmdc+/9DGwppiWKqGB/QM= +h1:1+ccsrCy1Elhcob9b7xjjzSeqcvX94svl2IgCvDssnM= diff --git a/tests/testdata/buf.build/community/nipunn1313-mypy/v3.7.0/eliza/plugin.sum b/tests/testdata/buf.build/community/nipunn1313-mypy/v3.7.0/eliza/plugin.sum index 08d7f893e..7149c9268 100644 --- a/tests/testdata/buf.build/community/nipunn1313-mypy/v3.7.0/eliza/plugin.sum +++ b/tests/testdata/buf.build/community/nipunn1313-mypy/v3.7.0/eliza/plugin.sum @@ -1 +1 @@ -h1:CtqY1NxS2gk2bFv8PBz8mQk3GjupMDtX3/EtkwqrA98= +h1:X9Br5AwJToHrw6lu0ljbVl9wvpd4GpxrfFlCcC1B9iw= diff --git a/tests/testdata/buf.build/community/nipunn1313-mypy/v3.7.0/petapis/plugin.sum b/tests/testdata/buf.build/community/nipunn1313-mypy/v3.7.0/petapis/plugin.sum index 1a1b88e22..87dac1589 100644 --- a/tests/testdata/buf.build/community/nipunn1313-mypy/v3.7.0/petapis/plugin.sum +++ b/tests/testdata/buf.build/community/nipunn1313-mypy/v3.7.0/petapis/plugin.sum @@ -1 +1 @@ -h1:4c+oVRabFfrSibgCEGpwDD16HNW95a20Oha5NXhzrfM= +h1:IEQlivL4185qyTk+yy9wL+KgEi+JCQ6XaWGXdrRT6s8=