From 522b294896aa41a7dfc1efd699d5354942455e78 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sandro=20J=C3=A4ckel?= Date: Fri, 26 Jul 2024 19:59:38 +0200 Subject: [PATCH] python312Packages.protobuf5: init at 5.27.2 in 5.XX.X the setup.py we used before from the repo got moved and the pypi source distribution doesn't seemingly require any packages to compile or supports the cpp implementation flag. see https://github.com/protocolbuffers/protobuf/commit/5722aeffcad72e9a335a3ec7985858dfa31477be for more details --- .../python-modules/protobuf/default.nix | 39 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 3 ++ 2 files changed, 42 insertions(+) create mode 100644 pkgs/development/python-modules/protobuf/default.nix diff --git a/pkgs/development/python-modules/protobuf/default.nix b/pkgs/development/python-modules/protobuf/default.nix new file mode 100644 index 000000000000..75dc81ccbad3 --- /dev/null +++ b/pkgs/development/python-modules/protobuf/default.nix @@ -0,0 +1,39 @@ +{ + buildPythonPackage, + fetchPypi, + lib, + setuptools, +}: + +buildPythonPackage rec { + pname = "protobuf"; + version = "5.27.2"; + pyproject = true; + + src = fetchPypi { + inherit pname version; + hash = "sha256-8+ze8ia5r4VgdfKCJ/8skM46WU0JLDm+5VE1c/JeJxQ="; + }; + + build-system = [ setuptools ]; + + # the pypi source archive does not ship tests + doCheck = false; + + pythonImportsCheck = [ + "google.protobuf" + "google.protobuf.compiler" + "google.protobuf.internal" + "google.protobuf.pyext" + "google.protobuf.testdata" + "google.protobuf.util" + "google._upb._message" + ]; + + meta = with lib; { + description = "Protocol Buffers are Google's data interchange format"; + homepage = "https://developers.google.com/protocol-buffers/"; + license = licenses.bsd3; + maintainers = with maintainers; [ SuperSandro2000 ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 085c63f7c3cc..87c117dc994d 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -10691,6 +10691,9 @@ self: super: with self; { protobuf = pkgs.protobuf; }; + # Protobuf 5.x + protobuf5 = callPackage ../development/python-modules/protobuf/default.nix { }; + # If a protobuf upgrade causes many Python packages to fail, please pin it here to the previous version. protobuf = protobuf4;