Skip to content
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
3 changes: 3 additions & 0 deletions plugins/community/nipunn1313-mypy-grpc/v3.7.0/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
*
!Dockerfile
!requirements.txt
19 changes: 19 additions & 0 deletions plugins/community/nipunn1313-mypy-grpc/v3.7.0/Dockerfile
Original file line number Diff line number Diff line change
@@ -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 \

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Had to switch source to . for the build to work. Switched this plugin to use distroless python.

&& 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" ]
26 changes: 26 additions & 0 deletions plugins/community/nipunn1313-mypy-grpc/v3.7.0/buf.plugin.yaml
Original file line number Diff line number Diff line change
@@ -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"

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated these deps based on the latest documented versions.

# 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"
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
mypy-protobuf==3.7.0
protobuf==6.33.1
types-protobuf==6.32.1.20251105
3 changes: 3 additions & 0 deletions plugins/community/nipunn1313-mypy/v3.7.0/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
*
!Dockerfile
!requirements.txt
19 changes: 19 additions & 0 deletions plugins/community/nipunn1313-mypy/v3.7.0/Dockerfile
Original file line number Diff line number Diff line change
@@ -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" ]
19 changes: 19 additions & 0 deletions plugins/community/nipunn1313-mypy/v3.7.0/buf.plugin.yaml
Original file line number Diff line number Diff line change
@@ -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"
3 changes: 3 additions & 0 deletions plugins/community/nipunn1313-mypy/v3.7.0/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
mypy-protobuf==3.7.0
protobuf==6.33.1
types-protobuf==6.32.1.20251105
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
h1:BYBWcreiMNyJTziSDWALko0+It2W4rJ10gW7o7SFwt0=
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
h1:1+ccsrCy1Elhcob9b7xjjzSeqcvX94svl2IgCvDssnM=
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
h1:X9Br5AwJToHrw6lu0ljbVl9wvpd4GpxrfFlCcC1B9iw=
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
h1:IEQlivL4185qyTk+yy9wL+KgEi+JCQ6XaWGXdrRT6s8=