|
1 | 1 | # License: MIT |
2 | 2 | # Copyright © 2023 Frequenz Energy-as-a-Service GmbH |
3 | 3 |
|
4 | | -"""Frequenz project setup tools and common configuration. |
| 4 | +r"""Frequenz project setup tools and common configuration. |
5 | 5 |
|
6 | 6 | The tools are provided to configure the main types of repositories most commonly used at |
7 | 7 | Frequenz, defined in |
|
166 | 166 | - `pytests/`: Directory containing the tests for the Python code. |
167 | 167 | - `submodules/api-common-protos`: Directory containing the submodule with the |
168 | 168 | `google/api-common-protos` repository. |
| 169 | +- `submodules/frequenz-api-common`: Directory containing the submodule with the |
| 170 | + `frequenz-floss/frequenz-api-common` repository. |
169 | 171 |
|
170 | 172 | Normally Frequenz APIs use basic types from |
171 | | -[`google/api-common-protos`](https://github.com/googleapis/api-common-protos), |
172 | | -so you need to make sure the proper submodule is added to your project: |
| 173 | +[`google/api-common-protos`](https://github.com/googleapis/api-common-protos) and |
| 174 | +[`frequenz-floss/frequenz-api-common`](https://github.com/frequenz-floss/frequenz-api-common), |
| 175 | +so you need to make sure the proper submodules are added to your project: |
173 | 176 |
|
174 | 177 | ```sh |
175 | 178 | mkdir submodules |
176 | | -git submodule add https://github.com:googleapis/api-common-protos.git submodules/api-common-protos |
177 | | -git commit -m "Add Google api-common-protos submodule" submodules/api-common-protos |
| 179 | +git submodule add https://github.com/googleapis/api-common-protos.git \ |
| 180 | + submodules/api-common-protos |
| 181 | +git submodule add https://github.com/frequenz-floss/frequenz-api-common.git \ |
| 182 | + submodules/frequenz-api-common |
| 183 | +git commit -m "Add api-common-protos and frequenz-api-common submodules" submodules |
178 | 184 | ``` |
179 | 185 |
|
180 | 186 | Then you need to add this package as a build dependency and a few extra |
|
190 | 196 |
|
191 | 197 | [project] |
192 | 198 | dependencies = [ |
| 199 | + "frequenz-api-common == 0.2.0", |
193 | 200 | "googleapis-common-protos == 1.56.2", |
194 | 201 | "grpcio == 1.51.0", |
195 | 202 | ] |
|
222 | 229 |
|
223 | 230 | ``` |
224 | 231 | recursive-include submodules/api-common-protos/google *.proto |
| 232 | +recursive-include submodules/frequenz-api-common/proto *.proto |
225 | 233 | ``` |
226 | 234 |
|
227 | 235 | If the defaults are not suitable for you (for example you need to use more or less |
|
236 | 244 | # Glob pattern to use to find the proto files in the proto_path (default: "*.proto") |
237 | 245 | proto_glob = "*.prt" # Default: "*.proto" |
238 | 246 | # List of paths to pass to the protoc compiler as include paths (default: |
239 | | -# ["submodules/api-common-protos"]) |
240 | | -include_paths = [] |
| 247 | +# ["submodules/api-common-protos", "submodules/frequenz-api-common/proto"]) |
| 248 | +include_paths = ["submodules/api-common-protos"] |
241 | 249 | # Path where to generate the Python files (default: "py") |
242 | 250 | py_path = "generated" |
243 | 251 | ``` |
|
0 commit comments