Skip to content

Commit ff38cd2

Browse files
committed
Pin grpc related dependencies
We can't use wide dependencies because otherwise when building the wheel, the latest version is used, but the generate code should use the minimum supported version for the generation, not the latest one. See: https://protobuf.dev/support/cross-version-runtime-guarantee/ Signed-off-by: Leandro Lucarella <[email protected]>
1 parent 0012cb3 commit ff38cd2

File tree

2 files changed

+17
-14
lines changed

2 files changed

+17
-14
lines changed

RELEASE_NOTES.md

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,5 @@
11
# Frequenz Common API Release Notes
22

3-
## Summary
4-
5-
<!-- Here goes a general summary of what this release is about -->
6-
7-
## Upgrading
8-
9-
<!-- Here goes notes on how to upgrade from previous versions, including deprecations and what they should be replaced with -->
10-
11-
## New Features
12-
13-
<!-- Here goes the main new features and examples or instructions on how to use them -->
14-
153
## Bug Fixes
164

17-
<!-- Here goes notable bug fixes that are worth a special mention or explanation -->
5+
- Fix a dependency issue by pinning the `grpcio` version and related libraries.

pyproject.toml

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,13 @@ requires = [
66
"setuptools == 68.1.0",
77
"setuptools_scm[toml] == 7.1.0",
88
"frequenz-repo-config[api] == 0.9.2",
9+
# We need to pin the protobuf, grpcio and grpcio-tools dependencies to make
10+
# sure the code is generated using the minimum supported versions, as older
11+
# versions can't work with code that was generated with newer versions.
12+
# https://protobuf.dev/support/cross-version-runtime-guarantee/#backwards
13+
"protobuf == 4.25.3",
14+
"grpcio-tools == 1.51.1",
15+
"grpcio == 1.51.1",
916
]
1017
build-backend = "setuptools.build_meta"
1118

@@ -25,7 +32,15 @@ classifiers = [
2532
"Typing :: Typed",
2633
]
2734
requires-python = ">= 3.11, < 4"
28-
dependencies = ["grpcio >= 1.51.1, < 2", "protobuf >= 4.25.3, < 6"]
35+
dependencies = [
36+
# We can't widen beyond 6 because of protobuf cross-version runtime guarantees
37+
# https://protobuf.dev/support/cross-version-runtime-guarantee/#major
38+
"protobuf >= 4.25.3, < 6", # Do not widen beyond 6!
39+
# We couldn't find any document with a spec about the cross-version runtime
40+
# guarantee for grpcio, so unless we find one in the future, we'll assume
41+
# major version jumps are not compatible
42+
"grpcio >= 1.51.1, < 2", # Do not widen beyond 2!
43+
]
2944
dynamic = ["version"]
3045

3146
[[project.authors]]

0 commit comments

Comments
 (0)