lol

python3Packages.protobuf: use pkgs.protobuf_24

+12 -14
+11 -13
pkgs/development/python-modules/protobuf/default.nix
··· 11 , tzdata 12 }: 13 14 let 15 - versionMajor = lib.versions.major protobuf.version; 16 - versionMinor = lib.versions.minor protobuf.version; 17 - versionPatch = lib.versions.patch protobuf.version; 18 in 19 buildPythonPackage { 20 inherit (protobuf) pname src; 21 22 - # protobuf 3.21 corresponds with its python library 4.21 23 - version = 24 - if lib.versionAtLeast protobuf.version "3.21" 25 - then "${toString (lib.toInt versionMajor + 1)}.${versionMinor}.${versionPatch}" 26 - else protobuf.version; 27 28 sourceRoot = "${protobuf.src.name}/python"; 29 30 - patches = lib.optionals (lib.versionAtLeast protobuf.version "3.22") [ 31 # Replace the vendored abseil-cpp with nixpkgs' 32 (substituteAll { 33 src = ./use-nixpkgs-abseil-cpp.patch; 34 abseil_cpp_include_path = "${lib.getDev protobuf.abseil-cpp}/include"; 35 }) 36 ] 37 - ++ lib.optionals (pythonAtLeast "3.11" && lib.versionOlder protobuf.version "3.22") [ 38 (fetchpatch { 39 name = "support-python311.patch"; 40 url = "https://github.com/protocolbuffers/protobuf/commit/2206b63c4649cf2e8a06b66c9191c8ef862ca519.diff"; ··· 69 70 propagatedNativeBuildInputs = [ 71 # For protoc of the same version. 72 - buildPackages."protobuf${lib.versions.major protobuf.version}_${lib.versions.minor protobuf.version}" 73 ]; 74 75 setupPyGlobalFlags = [ "--cpp_implementation" ]; 76 77 nativeCheckInputs = [ 78 pytestCheckHook 79 - ] ++ lib.optionals (lib.versionAtLeast protobuf.version "3.22") [ 80 numpy 81 ]; 82 ··· 90 "testStrictUtf8Check" 91 ]; 92 93 - disabledTestPaths = lib.optionals (lib.versionAtLeast protobuf.version "3.23") [ 94 # The following commit (I think) added some internal test logic for Google 95 # that broke generator_test.py. There is a new proto file that setup.py is 96 # not generating into a .py file. However, adding this breaks a bunch of
··· 11 , tzdata 12 }: 13 14 + assert lib.versionOlder protobuf.version "21" -> throw "Protobuf 21 or newer required"; 15 + 16 let 17 + protobufVersionMajor = lib.versions.major protobuf.version; 18 + protobufVersionMinor = lib.versions.minor protobuf.version; 19 in 20 buildPythonPackage { 21 inherit (protobuf) pname src; 22 23 + # protobuf 21 corresponds with its python library 4.21 24 + version = "4.${protobufVersionMajor}.${protobufVersionMinor}"; 25 26 sourceRoot = "${protobuf.src.name}/python"; 27 28 + patches = lib.optionals (lib.versionAtLeast protobuf.version "22") [ 29 # Replace the vendored abseil-cpp with nixpkgs' 30 (substituteAll { 31 src = ./use-nixpkgs-abseil-cpp.patch; 32 abseil_cpp_include_path = "${lib.getDev protobuf.abseil-cpp}/include"; 33 }) 34 ] 35 + ++ lib.optionals (pythonAtLeast "3.11" && lib.versionOlder protobuf.version "22") [ 36 (fetchpatch { 37 name = "support-python311.patch"; 38 url = "https://github.com/protocolbuffers/protobuf/commit/2206b63c4649cf2e8a06b66c9191c8ef862ca519.diff"; ··· 67 68 propagatedNativeBuildInputs = [ 69 # For protoc of the same version. 70 + buildPackages."protobuf_${protobufVersionMajor}" 71 ]; 72 73 setupPyGlobalFlags = [ "--cpp_implementation" ]; 74 75 nativeCheckInputs = [ 76 pytestCheckHook 77 + ] ++ lib.optionals (lib.versionAtLeast protobuf.version "22") [ 78 numpy 79 ]; 80 ··· 88 "testStrictUtf8Check" 89 ]; 90 91 + disabledTestPaths = lib.optionals (lib.versionAtLeast protobuf.version "23") [ 92 # The following commit (I think) added some internal test logic for Google 93 # that broke generator_test.py. There is a new proto file that setup.py is 94 # not generating into a .py file. However, adding this breaks a bunch of
+1 -1
pkgs/top-level/python-packages.nix
··· 9487 # Protobuf 4.x 9488 protobuf = callPackage ../development/python-modules/protobuf { 9489 # If a protobuf upgrade causes many Python packages to fail, please pin it here to the previous version. 9490 - inherit (pkgs) protobuf; 9491 }; 9492 9493 # Protobuf 3.x
··· 9487 # Protobuf 4.x 9488 protobuf = callPackage ../development/python-modules/protobuf { 9489 # If a protobuf upgrade causes many Python packages to fail, please pin it here to the previous version. 9490 + protobuf = pkgs.protobuf_24; 9491 }; 9492 9493 # Protobuf 3.x