Skip to content

Commit e02afad

Browse files
authored
chore(storage): commit generated proto files (#7046)
Instructions on how to generate the python files for the storage protos. And then generate and commit said protos.
1 parent 4f94bc1 commit e02afad

10 files changed

Lines changed: 4061 additions & 2 deletions

File tree

ci/cloudbuild/builds/checkers.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ time {
7575
# A couple useful invocations:
7676
# $ typos --write-changes # writes spelling fixes back to disk
7777
# $ typos --dump-config - # dumps effective config to stdout
78-
typos
78+
typos --exclude 'google/cloud/storage/emulator/google/**'
7979
}
8080

8181
printf "%-30s" "Running markdown generators:" >&2
@@ -153,7 +153,8 @@ time {
153153
# https://pypi.org/project/black/
154154
printf "%-30s" "Running black:" >&2
155155
time {
156-
git ls-files -z | grep -z '\.py$' | xargs -0 python3 -m black --quiet
156+
git ls-files -z | grep -z -v 'google/cloud/storage/emulator/google' |
157+
grep -z '\.py$' | xargs -0 python3 -m black --quiet
157158
}
158159

159160
# Apply shfmt to format all shell scripts

google/cloud/storage/emulator/README.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,34 @@ not as a general purpose emulator.
1414
pip install -r requirements.txt
1515
```
1616

17+
## Updating Proto Files
18+
19+
From time to time you may need to update the files generated by protobuf and
20+
gRPC. To do so, clone the [protos](https://github.com/googleapis/googleapis) and
21+
run the grpc_tools generator:
22+
23+
```shell
24+
cd $HOME
25+
git clone https://github.com/googleapis/googleapis
26+
cd google-cloud-cpp
27+
python -m grpc_tools.protoc -I$HOME/googleapis \
28+
--python_out=google/cloud/storage/emulator \
29+
--grpc_python_out=google/cloud/storage/emulator \
30+
$HOME/googleapis/google/iam/v1/iam_policy.proto
31+
python -m grpc_tools.protoc -I$HOME/googleapis \
32+
--python_out=google/cloud/storage/emulator \
33+
--grpc_python_out=google/cloud/storage/emulator \
34+
$HOME/googleapis/google/iam/v1/options.proto
35+
python -m grpc_tools.protoc -I$HOME/googleapis \
36+
--python_out=google/cloud/storage/emulator \
37+
--grpc_python_out=google/cloud/storage/emulator \
38+
$HOME/googleapis/google/iam/v1/policy.proto
39+
python -m grpc_tools.protoc -I$HOME/googleapis \
40+
--python_out=google/cloud/storage/emulator \
41+
--grpc_python_out=google/cloud/storage/emulator \
42+
$HOME/googleapis/google/storage/v2/storage.proto
43+
```
44+
1745
## Run Tests
1846

1947
Tests use https://docs.python.org/3/library/unittest.html and can be ran using:

google/cloud/storage/emulator/google/iam/v1/iam_policy_pb2.py

Lines changed: 272 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)