Skip to content

Commit

Permalink
Add mypy plugins to community (#470)
Browse files Browse the repository at this point in the history
Add the mypy and mypy-grpc plugins.

Fixes #219, #360, #452.
  • Loading branch information
pkwarren authored Apr 4, 2023
1 parent 6e38506 commit a33c4bf
Show file tree
Hide file tree
Showing 14 changed files with 72 additions and 0 deletions.
4 changes: 4 additions & 0 deletions plugins/community/nipunn1313-mypy-grpc/source.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
source:
github:
owner: nipunn1313
repository: mypy-protobuf
3 changes: 3 additions & 0 deletions plugins/community/nipunn1313-mypy-grpc/v3.4.0/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
*
!Dockerfile
!requirements.txt
15 changes: 15 additions & 0 deletions plugins/community/nipunn1313-mypy-grpc/v3.4.0/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# syntax=docker/dockerfile:1.4
FROM python:3.11.2-alpine3.17 AS build
WORKDIR /app
RUN python -mvenv /app
ADD /requirements.txt requirements.txt
RUN source ./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

FROM python:3.11.2-alpine3.17
COPY --from=build --link /app /app
USER nobody
ENTRYPOINT [ "/app/bin/protoc-gen-mypy_grpc" ]
9 changes: 9 additions & 0 deletions plugins/community/nipunn1313-mypy-grpc/v3.4.0/buf.plugin.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
version: v1
name: buf.build/community/nipunn1313-mypy-grpc
plugin_version: v3.4.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.4.0/LICENSE
output_languages:
- python
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
mypy-protobuf==3.4.0
protobuf==4.22.1
types-protobuf==4.22.0.2
4 changes: 4 additions & 0 deletions plugins/community/nipunn1313-mypy/source.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
source:
github:
owner: nipunn1313
repository: mypy-protobuf
3 changes: 3 additions & 0 deletions plugins/community/nipunn1313-mypy/v3.4.0/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
*
!Dockerfile
!requirements.txt
15 changes: 15 additions & 0 deletions plugins/community/nipunn1313-mypy/v3.4.0/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# syntax=docker/dockerfile:1.4
FROM python:3.11.2-alpine3.17 AS build
WORKDIR /app
RUN python -mvenv /app
ADD /requirements.txt requirements.txt
RUN source ./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

FROM python:3.11.2-alpine3.17
COPY --from=build --link /app /app
USER nobody
ENTRYPOINT [ "/app/bin/protoc-gen-mypy" ]
9 changes: 9 additions & 0 deletions plugins/community/nipunn1313-mypy/v3.4.0/buf.plugin.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
version: v1
name: buf.build/community/nipunn1313-mypy
plugin_version: v3.4.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.4.0/LICENSE
output_languages:
- python
3 changes: 3 additions & 0 deletions plugins/community/nipunn1313-mypy/v3.4.0/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
mypy-protobuf==3.4.0
protobuf==4.22.1
types-protobuf==4.22.0.2
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
h1:A9N7pBCImjZXsRR9ABT9dmXFavxnOQRDMKxaM/RtxfQ=
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
h1:MWz8GNw9QHRiQZ1FZ/twTTwpQleK+Msf9BckmRsbSEg=
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
h1:g9p6eDyJyzHhp8zDP3ZbYIBl/CMoG5d8Q8mjMusOqY8=
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
h1:Si8XgIwUSUICXMVOAqHgRd4rUeUb7bEyD8yos4Ko2t8=

0 comments on commit a33c4bf

Please sign in to comment.