Skip to content

Commit

Permalink
chore(storage): commit generated proto files (googleapis#7046)
Browse files Browse the repository at this point in the history
Instructions on how to generate the python files for the storage protos.
And then generate and commit said protos.
  • Loading branch information
coryan authored Jul 23, 2021
1 parent 4f94bc1 commit e02afad
Show file tree
Hide file tree
Showing 10 changed files with 4,061 additions and 2 deletions.
5 changes: 3 additions & 2 deletions ci/cloudbuild/builds/checkers.sh
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ time {
# A couple useful invocations:
# $ typos --write-changes # writes spelling fixes back to disk
# $ typos --dump-config - # dumps effective config to stdout
typos
typos --exclude 'google/cloud/storage/emulator/google/**'
}

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

# Apply shfmt to format all shell scripts
Expand Down
28 changes: 28 additions & 0 deletions google/cloud/storage/emulator/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,34 @@ not as a general purpose emulator.
pip install -r requirements.txt
```

## Updating Proto Files

From time to time you may need to update the files generated by protobuf and
gRPC. To do so, clone the [protos](https://github.com/googleapis/googleapis) and
run the grpc_tools generator:

```shell
cd $HOME
git clone https://github.com/googleapis/googleapis
cd google-cloud-cpp
python -m grpc_tools.protoc -I$HOME/googleapis \
--python_out=google/cloud/storage/emulator \
--grpc_python_out=google/cloud/storage/emulator \
$HOME/googleapis/google/iam/v1/iam_policy.proto
python -m grpc_tools.protoc -I$HOME/googleapis \
--python_out=google/cloud/storage/emulator \
--grpc_python_out=google/cloud/storage/emulator \
$HOME/googleapis/google/iam/v1/options.proto
python -m grpc_tools.protoc -I$HOME/googleapis \
--python_out=google/cloud/storage/emulator \
--grpc_python_out=google/cloud/storage/emulator \
$HOME/googleapis/google/iam/v1/policy.proto
python -m grpc_tools.protoc -I$HOME/googleapis \
--python_out=google/cloud/storage/emulator \
--grpc_python_out=google/cloud/storage/emulator \
$HOME/googleapis/google/storage/v2/storage.proto
```

## Run Tests

Tests use https://docs.python.org/3/library/unittest.html and can be ran using:
Expand Down
272 changes: 272 additions & 0 deletions google/cloud/storage/emulator/google/iam/v1/iam_policy_pb2.py

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

Loading

0 comments on commit e02afad

Please sign in to comment.