File tree Expand file tree Collapse file tree 5 files changed +38
-4
lines changed
sdv/proto/sdv/databroker/v1 Expand file tree Collapse file tree 5 files changed +38
-4
lines changed Original file line number Diff line number Diff line change 316
316
"group" : " none" ,
317
317
"isBackground" : false ,
318
318
"problemMatcher" : []
319
+ },
320
+ {
321
+ "label" : " (Re-) generate gRPC stubs" ,
322
+ "detail" : " Re-generates the gRPC stubs located in sdv/proto folder" ,
323
+ "type" : " shell" ,
324
+ "command" : " ./generate-grpc-stubs.sh" ,
325
+ "group" : " none" ,
326
+ "isBackground" : false ,
327
+ "problemMatcher" : []
319
328
}
320
329
],
321
330
"inputs" : [
Original file line number Diff line number Diff line change @@ -49,9 +49,9 @@ https://www.eclipse.org/projects/handbook/#resources-commit
49
49
* When you make changes to existing protocol buffer files, regenerate the python descriptors with the following command:
50
50
51
51
``` bash
52
- python3 -m grpc_tools.protoc -I sdv/proto --grpc_python_out=./sdv/proto --python_out=./sdv/proto --mypy_out=./sdv/proto sdv/proto/ * / * / * .proto
52
+ ./generate-grpc-stubs.sh
53
53
```
54
- Afterwards adjust relative imports as needed .
54
+ or use the corresponding VSCode task .
55
55
* Make sure you include test cases and new examples for non-trivial features.
56
56
* Make sure test cases provide sufficient code coverage (see GitHub actions for minimal accepted coverage).
57
57
* Install and run [ pre-commit] ( https://pre-commit.com/ ) to automatically check for style guide issues.
Original file line number Diff line number Diff line change
1
+ #! /bin/zsh
2
+ # Copyright (c) 2023 Robert Bosch GmbH and Microsoft Corporation
3
+ #
4
+ # This program and the accompanying materials are made available under the
5
+ # terms of the Apache License, Version 2.0 which is available at
6
+ # https://www.apache.org/licenses/LICENSE-2.0.
7
+ #
8
+ # Unless required by applicable law or agreed to in writing, software
9
+ # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
10
+ # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
11
+ # License for the specific language governing permissions and limitations
12
+ # under the License.
13
+ #
14
+ # SPDX-License-Identifier: Apache-2.0
15
+
16
+ echo " #######################################################"
17
+ echo " ### Generating gRPC stubs from proto files ###"
18
+ echo " #######################################################"
19
+
20
+ ROOT_DIR=$( realpath " $( cd -- " $( dirname " $0 " ) " > /dev/null 2>&1 ; pwd -P ) " )
21
+
22
+ python3 -m grpc_tools.protoc -I ./sdv/proto --grpc_python_out=./sdv/proto --python_out=./sdv/proto --mypy_out=./sdv/proto ./sdv/proto/** /* .proto
23
+ mv -f ./sdv/proto/** /* .py ./sdv/proto
24
+ mv -f ./sdv/proto/** /* .pyi ./sdv/proto
25
+ sed -i -e ' s/from sdv\..* import/from sdv.proto import/g' -e ' s/import sdv\..*\./import sdv.proto./g' ./sdv/proto/* .py*
Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ syntax = "proto3";
16
16
17
17
package sdv.databroker.v1 ;
18
18
19
- import "types.proto" ;
19
+ import "sdv/databroker/v1/ types.proto" ;
20
20
21
21
service Broker {
22
22
// Request a set of datapoints (values)
Original file line number Diff line number Diff line change 14
14
15
15
syntax = "proto3" ;
16
16
17
- import "types.proto" ;
17
+ import "sdv/databroker/v1/ types.proto" ;
18
18
19
19
package sdv.databroker.v1 ;
20
20
You can’t perform that action at this time.
0 commit comments