Skip to content

Commit ebe12dd

Browse files
authored
Pin grpc related dependencies (#241)
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/
2 parents b354ac4 + ff38cd2 commit ebe12dd

File tree

2 files changed

+18
-8
lines changed

2 files changed

+18
-8
lines changed

RELEASE_NOTES.md

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,5 @@
11
# Frequenz Common API Release Notes
22

3-
## Summary
3+
## Bug Fixes
44

5-
This release adds a new component category `COMPONENT_CATEGORY_HVAC` to the API.
6-
7-
## New Features
8-
9-
- A new component category `COMPONENT_CATEGORY_HVAC` has been added to the API
10-
to represent HVAC (Heating, Ventilation, and Air Conditioning) systems.
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)