Skip to content

Commit 8448e95

Browse files
Bre77firstmate crewmateclaude
authored
fix(proto): pin protobuf gencode to 6.32.0 for Home Assistant compatibility (#40)
* Regenerate protobuf gencode for protobuf 6.32.0 (HA compat), bump to 1.5.2 Home Assistant core pins protobuf==6.32.0, but the 1.5.1 gencode was stamped 6.33.4 and calls ValidateProtobufRuntimeVersion(6, 33, 4, ...), which refuses to load on the 6.32.0 runtime (gencode newer than runtime => VersionError). This forced a core-wide protobuf bump when dropping the library into HA. Regenerate every *_pb2.py under tesla/vehicle/proto/ from the unchanged .proto sources using protoc v32.0 (tools/regenerate_protos.sh with protoc-32.0 on PATH), so the gencode is stamped 6.32.0. Only the version stamp lines change; the serialized descriptors are byte-identical, so this is a pure toolchain/version change with no schema drift. The .pyi stubs are unaffected (no version stamp). Raise the protobuf floor to >=6.32.0 to match the gencode: gencode 6.32.0 requires the runtime to be >= 6.32.0, so the previous >=6.31.1 floor was unsafe (a resolved 6.31.1 would VersionError at import). The floor is not raised above 6.32.0, so HA's exact pin still satisfies it. No upper cap: protobuf 7.x loads major-6 gencode without error, so a <7 cap would only exclude valid runtimes. Document the reproducible regen (protoc v32.0 -> 6.32.0 gencode, and the floor-must-match-gencode rule) in AGENTS.md. Bump version 1.5.1 -> 1.5.2. Verified with protobuf==6.32.0: all nine *_pb2 modules import cleanly and the full test suite passes (37 passed); 6.31.1 fails as expected. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * no-mistakes(document): Sync protoc/protobuf version docs with 6.32.0 gencode pin * no-mistakes(document): Bump upgradeProtoc.sh PROTOC_VERSION to 32.0 for gencode pin --------- Co-authored-by: firstmate crewmate <crewmate@firstmate.local> Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent a3ee30b commit 8448e95

17 files changed

Lines changed: 47 additions & 39 deletions

‎AGENTS.md‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,9 @@ All exceptions inherit from `TeslaFleetError(BaseException)`.
8787

8888
### Protobuf
8989

90-
Generated protobuf files live in `tesla/vehicle/proto/` and are excluded from ruff and pyright. Do not edit these directly.
90+
Generated protobuf files live in `tesla/vehicle/proto/` and are excluded from ruff and pyright. Do not edit these directly — regenerate them with `tools/regenerate_protos.sh` (needs `protoc` on `PATH`).
91+
92+
**Runtime-version pin (Home Assistant compatibility).** The gencode stamps a `ValidateProtobufRuntimeVersion(major, minor, patch, …)` call, and protobuf refuses to load gencode that is *newer* than the installed runtime (`gencode X > runtime` → `VersionError`). Home Assistant core pins `protobuf==6.32.0`, so the gencode must be stamped **≤ 6.32.0** or it breaks in HA. The generator version is the `protoc` version: under unified protobuf versioning, `protoc vX.Y` (`libprotoc X.Y`) stamps Python gencode `6.X.Y`. So to target runtime 6.32.0, regenerate with **protoc v32.0** (`protoc-32.0-linux-x86_64.zip` from the protobuf GitHub releases). The `protobuf>=6.32.0` floor in `pyproject.toml` must match the gencode version — never set it below the stamped version, or installs that resolve an older protobuf will hit `VersionError` at import.
9193

9294
## Code Style
9395

‎pyproject.toml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ requires = ["setuptools>=77.0"]
44

55
[project]
66
name = "tesla_fleet_api"
7-
version = "1.5.1"
7+
version = "1.5.2"
88
license = "Apache-2.0"
99
description = "Tesla Fleet API library for Python"
1010
readme = "README.md"
@@ -21,7 +21,7 @@ dependencies = [
2121
"aiofiles>=24",
2222
"aiolimiter>=1",
2323
"cryptography>=43",
24-
"protobuf>=6.31.1",
24+
"protobuf>=6.32.0",
2525
"bleak>=0.22",
2626
"bleak-retry-connector>=3.9",
2727
]

‎tesla_fleet_api.egg-info/PKG-INFO‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Metadata-Version: 2.4
22
Name: tesla_fleet_api
3-
Version: 1.5.1
3+
Version: 1.5.2
44
Summary: Tesla Fleet API library for Python
55
Author-email: Brett Adams <hello@teslemetry.com>
66
License-Expression: Apache-2.0
@@ -16,7 +16,7 @@ Requires-Dist: aiohttp>=3
1616
Requires-Dist: aiofiles>=24
1717
Requires-Dist: aiolimiter>=1
1818
Requires-Dist: cryptography>=43
19-
Requires-Dist: protobuf>=6.31.1
19+
Requires-Dist: protobuf>=6.32.0
2020
Requires-Dist: bleak>=0.22
2121
Requires-Dist: bleak-retry-connector>=3.9
2222
Dynamic: license-file

‎tesla_fleet_api.egg-info/requires.txt‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@ aiohttp>=3
22
aiofiles>=24
33
aiolimiter>=1
44
cryptography>=43
5-
protobuf>=6.31.1
5+
protobuf>=6.32.0
66
bleak>=0.22
77
bleak-retry-connector>=3.9

‎tesla_fleet_api/__init__.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"""Tesla Fleet API"""
22

33
__author__ = "hello@teslemetry.com"
4-
__version__ = "1.5.1"
4+
__version__ = "1.5.2"
55

66
from tesla_fleet_api.const import Region, is_valid_region
77
from tesla_fleet_api.tesla.bluetooth import TeslaBluetooth

‎tesla_fleet_api/tesla/vehicle/proto/car_server_pb2.py‎

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎tesla_fleet_api/tesla/vehicle/proto/common_pb2.py‎

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎tesla_fleet_api/tesla/vehicle/proto/errors_pb2.py‎

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎tesla_fleet_api/tesla/vehicle/proto/keys_pb2.py‎

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎tesla_fleet_api/tesla/vehicle/proto/managed_charging_pb2.py‎

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)