1{
2 buildPythonPackage,
3 fetchPypi,
4 lib,
5 python,
6 setuptools,
7 protobuf,
8}:
9
10buildPythonPackage rec {
11 pname = "protobuf";
12 version = "6.32.0";
13 pyproject = true;
14
15 src = fetchPypi {
16 inherit pname version;
17 hash = "sha256-qBQ5BJEnBn/EnsHTbiXG7h0aK3vpMGdfkZJY0DwE59I=";
18 };
19
20 build-system = [ setuptools ];
21
22 propagatedNativeBuildInputs = [
23 protobuf
24 ];
25
26 # the pypi source archive does not ship tests
27 doCheck = false;
28
29 pythonImportsCheck = [
30 "google.protobuf"
31 "google.protobuf.compiler"
32 "google.protobuf.internal"
33 "google.protobuf.pyext"
34 "google.protobuf.testdata"
35 "google.protobuf.util"
36 "google._upb._message"
37 ];
38
39 # Tries to explicitly create a namespace package with pkg_resources,
40 # which breaks everything with our PYTHONPATH setup.
41 postInstall = ''
42 rm $out/${python.sitePackages}/google/__init__.py
43 '';
44
45 meta = {
46 description = "Protocol Buffers are Google's data interchange format";
47 homepage = "https://developers.google.com/protocol-buffers/";
48 changelog = "https://github.com/protocolbuffers/protobuf/releases/v${version}";
49 license = lib.licenses.bsd3;
50 maintainers = with lib.maintainers; [ GaetanLepage ];
51 };
52}