From f4e22d09baba1c87ef9c01559d234eba55ac1664 Mon Sep 17 00:00:00 2001 From: Mish Ushakov <10400064+mishushakov@users.noreply.github.com> Date: Tue, 18 Aug 2026 01:22:53 +0200 Subject: [PATCH] python3Packages.protobuf-py: init at 0.1.1 Buf's idiomatic Protocol Buffers runtime for Python, required by connectrpc and the E2B Python SDK. Fetched from PyPI because upstream has no tag for this release; its only tag is v0.2.0, which neither connectrpc nor e2b accepts yet. Assisted-by: Claude Code (Claude Opus 5) --- .../python-modules/protobuf-py/default.nix | 51 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 53 insertions(+) create mode 100644 pkgs/development/python-modules/protobuf-py/default.nix diff --git a/pkgs/development/python-modules/protobuf-py/default.nix b/pkgs/development/python-modules/protobuf-py/default.nix new file mode 100644 index 000000000000..8a01100ac9c5 --- /dev/null +++ b/pkgs/development/python-modules/protobuf-py/default.nix @@ -0,0 +1,51 @@ +{ + lib, + buildPythonPackage, + fetchPypi, + + # build-system + uv-build, + + # dependencies + protobuf-py-ext, +}: + +buildPythonPackage (finalAttrs: { + pname = "protobuf-py"; + # connectrpc requires this exact version and e2b requires <0.2; bump all three + # together. + version = "0.1.1"; + pyproject = true; + __structuredAttrs = true; + + # No tag on GitHub for this release: bufbuild/protobuf-py's only tag is v0.2.0, + # which connectrpc (`protobuf-py==0.1.1`) and e2b (`<0.2`) do not accept yet. + src = fetchPypi { + pname = "protobuf_py"; + inherit (finalAttrs) version; + hash = "sha256-a9CKxNjxZhllu+JoVCnXkENwTN0e5yCnqJYXMxdCJAs="; + }; + + build-system = [ + uv-build + ]; + + dependencies = [ + protobuf-py-ext + ]; + + pythonImportsCheck = [ "protobuf" ]; + + # The test suite is not part of the PyPI sdist and there is no git tag for this + # release. Note that protobuf swallows an ImportError from protobuf_ext and + # falls back to pure Python, so a broken accelerator would not surface here — + # protobuf-py-ext's own pythonImportsCheck is what guards that. + doCheck = false; + + meta = { + description = "Idiomatic Protocol Buffers for Python"; + homepage = "https://github.com/bufbuild/protobuf-py"; + license = lib.licenses.asl20; + maintainers = with lib.maintainers; [ mishushakov ]; + }; +}) diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index e4034114f142..e0ae79a0b42a 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -13663,6 +13663,8 @@ self: super: with self; { # If a protobuf upgrade causes many Python packages to fail, please pin it here to the previous version. protobuf = protobuf7; + protobuf-py = callPackage ../development/python-modules/protobuf-py { }; + protobuf-py-ext = callPackage ../development/python-modules/protobuf-py-ext { }; protobuf3-to-dict = callPackage ../development/python-modules/protobuf3-to-dict { };