From 37fe704326d60c8609c8ea834415064689ea542b Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Wed, 16 Jul 2025 14:14:50 +0700 Subject: [PATCH] Tweak protobuf requirements MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Motivated by https://forums.ankiweb.net/t/python-anki-sync-server-broken/64069 From https://protobuf.dev/support/cross-version-runtime-guarantee/: "Python-specific Guarantees Since the 3.20.0 release, the Protobuf Python generated code became a thin wrapper around an embedded FileDescriptorProto. Because these protos are supported on extremely long timeframes, our usual major version compatibility windows aren’t typically necessary. Python may break generated code compatibility in specific future major version releases, but it will be coupled with poison pill warnings and errors in advance. As of 6.32.0, all generated code since 3.20.0 will be supported until at least 8.x.y." --- pylib/pyproject.toml | 2 +- uv.lock | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pylib/pyproject.toml b/pylib/pyproject.toml index 23e10077f..fb7422694 100644 --- a/pylib/pyproject.toml +++ b/pylib/pyproject.toml @@ -7,7 +7,7 @@ dependencies = [ "decorator", "markdown", "orjson", - "protobuf>=4.21", + "protobuf>=6.0,<8.0", "requests[socks]", # remove after we update to min python 3.11+ "typing_extensions", diff --git a/uv.lock b/uv.lock index 5a1a7ded9..d4277425a 100644 --- a/uv.lock +++ b/uv.lock @@ -66,7 +66,7 @@ requires-dist = [ { name = "distro", marker = "sys_platform != 'darwin' and sys_platform != 'win32'" }, { name = "markdown" }, { name = "orjson" }, - { name = "protobuf", specifier = ">=4.21" }, + { name = "protobuf", specifier = ">=6.0,<8.0" }, { name = "requests", extras = ["socks"] }, { name = "typing-extensions" }, ]