Skip to content

Commit 2fc97d5

Browse files
committed
Don't include google-common-protos in API projects by default
We generally don't use it, so there is no point in including it by default. If it is needed, it can be added manually. Signed-off-by: Leandro Lucarella <[email protected]>
1 parent 21cb7f1 commit 2fc97d5

File tree

7 files changed

+6
-23
lines changed

7 files changed

+6
-23
lines changed

RELEASE_NOTES.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
### Cookiecutter template
2020

2121
* Group GitHub Actions dependabot updates.
22+
* API projects don't include the `google-common-protos` dependency by default.
2223

2324
## Bug Fixes
2425

cookiecutter/{{cookiecutter.github_repo_name}}/.gitmodules

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
{% if cookiecutter.type == "api" -%}
2-
[submodule "submodules/api-common-protos"]
3-
path = submodules/api-common-protos
4-
url = https://github.com/googleapis/api-common-protos.git
52
[submodule "submodules/frequenz-api-common"]
63
path = submodules/frequenz-api-common
74
url = https://github.com/frequenz-floss/frequenz-api-common.git

cookiecutter/{{cookiecutter.github_repo_name}}/pyproject.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ dependencies = [
4444
{%- elif cookiecutter.type == "api" %}
4545
dependencies = [
4646
"frequenz-api-common >= 0.5.0, < 0.6.0",
47-
"googleapis-common-protos >= 1.56.2, < 2",
4847
"grpcio >= 1.51.1, < 2",
4948
]
5049
{%- else %}

src/frequenz/repo/config/__init__.py

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -340,8 +340,8 @@
340340
# Glob pattern to use to find the proto files in the proto_path (default: "*.proto")
341341
proto_glob = "*.prt" # Default: "*.proto"
342342
# List of paths to pass to the protoc compiler as include paths (default:
343-
# ["submodules/api-common-protos", "submodules/frequenz-api-common/proto"])
344-
include_paths = ["submodules/api-common-protos"]
343+
# ["submodules/frequenz-api-common/proto"])
344+
include_paths = ["submodules/frequenz-api-common/proto"]
345345
# Path where to generate the Python files (default: "py")
346346
py_path = "generated"
347347
# Path where to generate the documentation files (default: "protobuf-reference")
@@ -376,23 +376,18 @@
376376
section plus the following:
377377
378378
- `pytests/`: Directory containing the tests for the Python code.
379-
- `submodules/api-common-protos`: Directory containing the Git submodule with the
380-
`google/api-common-protos` repository.
381379
- `submodules/frequenz-api-common`: Directory containing the Git submodule with the
382380
`frequenz-floss/frequenz-api-common` repository.
383381
384382
Normally Frequenz APIs use basic types from
385-
[`google/api-common-protos`](https://github.com/googleapis/api-common-protos) and
386383
[`frequenz-floss/frequenz-api-common`](https://github.com/frequenz-floss/frequenz-api-common),
387384
so you need to make sure the proper submodules are added to your project:
388385
389386
```sh
390387
mkdir submodules
391-
git submodule add https://github.com/googleapis/api-common-protos.git \
392-
submodules/api-common-protos
393388
git submodule add https://github.com/frequenz-floss/frequenz-api-common.git \
394389
submodules/frequenz-api-common
395-
git commit -m "Add api-common-protos and frequenz-api-common submodules" submodules
390+
git commit -m "Add frequenz-api-common submodule" submodules
396391
```
397392
398393
Then you need to add this package as a build dependency and a few extra
@@ -435,13 +430,11 @@
435430
```
436431
437432
Finally you need to make sure to include the generated `*.pyi` files in the
438-
source distribution, as well as the Google api-common-protos files, as it
439-
is not handled automatically yet
433+
source distribution, as it is not handled automatically yet
440434
([#13](https://github.com/frequenz-floss/frequenz-repo-config-python/issues/13)).
441435
Make sure to include these lines in the `MANIFEST.in` file:
442436
443437
```
444-
recursive-include submodules/api-common-protos/google *.proto
445438
recursive-include submodules/frequenz-api-common/proto *.proto
446439
```
447440

src/frequenz/repo/config/protobuf.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,7 @@ class ProtobufConfig:
2727
proto_glob: str = "*.proto"
2828
"""The glob pattern to use to find the protobuf files."""
2929

30-
include_paths: Sequence[str] = (
31-
"submodules/api-common-protos",
32-
"submodules/frequenz-api-common/proto",
33-
)
30+
include_paths: Sequence[str] = ("submodules/frequenz-api-common/proto",)
3431
"""The paths to add to the include path when compiling the protobuf files."""
3532

3633
py_path: str = "py"
Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
[submodule "submodules/api-common-protos"]
2-
path = submodules/api-common-protos
3-
url = https://github.com/googleapis/api-common-protos.git
41
[submodule "submodules/frequenz-api-common"]
52
path = submodules/frequenz-api-common
63
url = https://github.com/frequenz-floss/frequenz-api-common.git

tests_golden/integration/test_cookiecutter_generation/api/frequenz-api-test/pyproject.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ requires-python = ">= 3.11, < 4"
2929
# TODO(cookiecutter): Remove and add more dependencies if appropriate
3030
dependencies = [
3131
"frequenz-api-common >= 0.5.0, < 0.6.0",
32-
"googleapis-common-protos >= 1.56.2, < 2",
3332
"grpcio >= 1.51.1, < 2",
3433
]
3534
dynamic = ["version"]

0 commit comments

Comments
 (0)