From b12bda4c96895842a0f80d914547c06722d85d2c Mon Sep 17 00:00:00 2001 From: Leandro Lucarella Date: Wed, 11 Sep 2024 12:03:26 +0200 Subject: [PATCH] Bump the `frequenz-api-common` dependency to `0.6.0` Signed-off-by: Leandro Lucarella --- RELEASE_NOTES.md | 1 + .../mkdocs.yml | 2 +- .../pyproject.toml | 20 +++++++++++++++++-- .../api/frequenz-api-test/mkdocs.yml | 2 +- .../api/frequenz-api-test/pyproject.toml | 18 +++++++++++++++-- 5 files changed, 37 insertions(+), 6 deletions(-) diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index 99271b9d..4b34be7d 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -21,6 +21,7 @@ * Group GitHub Actions dependabot updates. * API projects don't include the `google-common-protos` dependency by default. * API projects updated the `grpcio` dependency to `1.66.1`. +* API projects updated the `frequenz-api-common` dependency to `0.6`. ## Bug Fixes diff --git a/cookiecutter/{{cookiecutter.github_repo_name}}/mkdocs.yml b/cookiecutter/{{cookiecutter.github_repo_name}}/mkdocs.yml index 6120ff7d..21eb3b26 100644 --- a/cookiecutter/{{cookiecutter.github_repo_name}}/mkdocs.yml +++ b/cookiecutter/{{cookiecutter.github_repo_name}}/mkdocs.yml @@ -124,7 +124,7 @@ plugins: - https://frequenz-floss.github.io/frequenz-channels-python/v0.16/objects.inv - https://frequenz-floss.github.io/frequenz-sdk-python/v0.25/objects.inv {%- elif cookiecutter.type == "api" %} - - https://frequenz-floss.github.io/frequenz-api-common/v0.3/objects.inv + - https://frequenz-floss.github.io/frequenz-api-common/v0.6/objects.inv - https://grpc.github.io/grpc/python/objects.inv {%- endif %} - https://typing-extensions.readthedocs.io/en/stable/objects.inv diff --git a/cookiecutter/{{cookiecutter.github_repo_name}}/pyproject.toml b/cookiecutter/{{cookiecutter.github_repo_name}}/pyproject.toml index d6032409..d422d7bd 100644 --- a/cookiecutter/{{cookiecutter.github_repo_name}}/pyproject.toml +++ b/cookiecutter/{{cookiecutter.github_repo_name}}/pyproject.toml @@ -6,6 +6,15 @@ requires = [ "setuptools == 70.1.1", "setuptools_scm[toml] == 8.1.0", "frequenz-repo-config[{{cookiecutter.type}}] == 0.10.0", +{%- if cookiecutter.type == "api" %} + # We need to pin the protobuf, grpcio and grpcio-tools dependencies to make + # sure the code is generated using the minimum supported versions, as older + # versions can't work with code that was generated with newer versions. + # https://protobuf.dev/support/cross-version-runtime-guarantee/#backwards + "protobuf == 5.28.0", + "grpcio-tools == 1.66.1", + "grpcio == 1.66.1", +{%- endif %} ] build-backend = "setuptools.build_meta" @@ -43,8 +52,15 @@ dependencies = [ ] {%- elif cookiecutter.type == "api" %} dependencies = [ - "frequenz-api-common >= 0.5.0, < 0.6.0", - "grpcio >= 1.66.1, < 2", + "frequenz-api-common >= 0.6.2, < 0.7.0", + # We can't widen beyond the current value unless we bump the minimum + # requirements too because of protobuf cross-version runtime guarantees: + # https://protobuf.dev/support/cross-version-runtime-guarantee/#major + "protobuf >= 5.28.0, < 7", # Do not widen beyond 7! + # We couldn't find any document with a spec about the cross-version runtime + # guarantee for grpcio, so unless we find one in the future, we'll assume + # major version jumps are not compatible + "grpcio >= 1.66.1, < 2", # Do not widen beyond 2! ] {%- else %} dependencies = [ diff --git a/tests_golden/integration/test_cookiecutter_generation/api/frequenz-api-test/mkdocs.yml b/tests_golden/integration/test_cookiecutter_generation/api/frequenz-api-test/mkdocs.yml index bf29caff..fea1965e 100644 --- a/tests_golden/integration/test_cookiecutter_generation/api/frequenz-api-test/mkdocs.yml +++ b/tests_golden/integration/test_cookiecutter_generation/api/frequenz-api-test/mkdocs.yml @@ -120,7 +120,7 @@ plugins: # TODO(cookiecutter): You might want to add other external references here # See https://mkdocstrings.github.io/python/usage/#import for details - https://docs.python.org/3/objects.inv - - https://frequenz-floss.github.io/frequenz-api-common/v0.3/objects.inv + - https://frequenz-floss.github.io/frequenz-api-common/v0.6/objects.inv - https://grpc.github.io/grpc/python/objects.inv - https://typing-extensions.readthedocs.io/en/stable/objects.inv # Note this plugin must be loaded after mkdocstrings to be able to use macros diff --git a/tests_golden/integration/test_cookiecutter_generation/api/frequenz-api-test/pyproject.toml b/tests_golden/integration/test_cookiecutter_generation/api/frequenz-api-test/pyproject.toml index 82311d57..a0f7b83d 100644 --- a/tests_golden/integration/test_cookiecutter_generation/api/frequenz-api-test/pyproject.toml +++ b/tests_golden/integration/test_cookiecutter_generation/api/frequenz-api-test/pyproject.toml @@ -6,6 +6,13 @@ requires = [ "setuptools == 70.1.1", "setuptools_scm[toml] == 8.1.0", "frequenz-repo-config[api] == 0.10.0", + # We need to pin the protobuf, grpcio and grpcio-tools dependencies to make + # sure the code is generated using the minimum supported versions, as older + # versions can't work with code that was generated with newer versions. + # https://protobuf.dev/support/cross-version-runtime-guarantee/#backwards + "protobuf == 5.28.0", + "grpcio-tools == 1.66.1", + "grpcio == 1.66.1", ] build-backend = "setuptools.build_meta" @@ -28,8 +35,15 @@ classifiers = [ requires-python = ">= 3.11, < 4" # TODO(cookiecutter): Remove and add more dependencies if appropriate dependencies = [ - "frequenz-api-common >= 0.5.0, < 0.6.0", - "grpcio >= 1.66.1, < 2", + "frequenz-api-common >= 0.6.2, < 0.7.0", + # We can't widen beyond the current value unless we bump the minimum + # requirements too because of protobuf cross-version runtime guarantees: + # https://protobuf.dev/support/cross-version-runtime-guarantee/#major + "protobuf >= 5.28.0, < 7", # Do not widen beyond 7! + # We couldn't find any document with a spec about the cross-version runtime + # guarantee for grpcio, so unless we find one in the future, we'll assume + # major version jumps are not compatible + "grpcio >= 1.66.1, < 2", # Do not widen beyond 2! ] dynamic = ["version"]