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

Generate gRPC API using buf #261

Merged
merged 3 commits into from
May 27, 2022
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
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
*.py ident
*.sh ident
a3m/api/** linguist-generated
docs/** linguist-documentation
12 changes: 12 additions & 0 deletions .github/workflows/buf-pull-request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: Buf (pull request)
on: pull_request
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: bufbuild/buf-setup-action@v1
- uses: bufbuild/buf-lint-action@v1
with:
input: proto
# TODO: use buf-breaking-action when ready
19 changes: 19 additions & 0 deletions .github/workflows/buf-push.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Buf (push)
on:
push:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: bufbuild/buf-setup-action@v1
- uses: bufbuild/buf-lint-action@v1
with:
input: proto
# TODO: use buf-breaking-action when ready
- uses: bufbuild/buf-push-action@v1
with:
input: proto
buf_token: ${{ secrets.BUF_TOKEN }}
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ repos:
- id: reorder-python-imports
args: ["--application-directories=.:src", "--py37-plus"]
- repo: https://github.com/jazzband/pip-tools
rev: 6.5.1
rev: 6.6.2
hooks:
- id: pip-compile
files: |
Expand All @@ -27,7 +27,7 @@ repos:
)$
args: ["--output-file=requirements.txt"]
- repo: https://github.com/jazzband/pip-tools
rev: 6.5.1
rev: 6.6.2
hooks:
- id: pip-compile
files: |
Expand Down
17 changes: 7 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -134,16 +134,13 @@ amflow: ## Display the workflow in amflow.
artefactual/amflow:latest \
edit --file=/workflow.json

.PHONY: protoc
protoc: ## Generate gRPC code.
$(call compose_run, \
--entrypoint python \
a3m \
-m grpc_tools.protoc -I=. --python_out=. --grpc_python_out=. a3m/server/rpc/proto/a3m.proto)
$(call compose_run, \
--entrypoint black \
a3m \
a3m/server/rpc/proto)
.PHONY: buf
buf:
docker run \
--volume "$(CURDIR)/proto:/workspace" \
--workdir /workspace \
bufbuild/buf:1.4.0 \
$(ARG)

.PHONY: help
help: ## Print this help message.
Expand Down
12 changes: 12 additions & 0 deletions a3m/api/transferservice/v1beta1/__init__.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

53 changes: 53 additions & 0 deletions a3m/api/transferservice/v1beta1/request_response_pb2.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading