croc: 10.1.1 -> 10.1.3 (#364662)
[NixPkgs.git] / pkgs / development / python-modules / consonance / default.nix
blobc19fb148e56b9471e0ce13a84f8922cc6ae72262
2   lib,
3   buildPythonPackage,
4   fetchFromGitHub,
5   fetchpatch,
6   setuptools,
7   dissononce,
8   python-axolotl-curve25519,
9   transitions,
10   protobuf,
11   pytestCheckHook,
12   pythonOlder,
15 buildPythonPackage rec {
16   pname = "consonance";
17   version = "0.1.5";
18   pyproject = true;
20   disabled = pythonOlder "3.7";
22   src = fetchFromGitHub {
23     owner = "tgalal";
24     repo = "consonance";
25     rev = "refs/tags/${version}";
26     hash = "sha256-BhgxLxjKZ4dSL7DqkaoS+wBPCd1SYZomRKrtDLdGmYQ=";
27   };
29   patches = [
30     # https://github.com/tgalal/consonance/pull/9
31     (fetchpatch {
32       name = "fix-type-error.patch";
33       url = "https://github.com/tgalal/consonance/pull/9/commits/92fb78af98a18f0533ec8a286136968174fb0baf.patch";
34       hash = "sha256-wVUGxZ4W2zPyrcQPQTc85LcRUtsLbTBVzS10NEolpQY=";
35     })
36   ];
38   env = {
39     # make protobuf compatible with old versions
40     # https://developers.google.com/protocol-buffers/docs/news/2022-05-06#python-updates
41     PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION = "python";
42   };
44   build-system = [ setuptools ];
46   dependencies = [
47     dissononce
48     python-axolotl-curve25519
49     transitions
50     protobuf
51   ];
53   nativeCheckInputs = [ pytestCheckHook ];
55   pytestFlagsArray = [ "tests/test_handshakes_offline.py" ];
57   pythonImportsCheck = [ "consonance" ];
59   meta = {
60     description = "WhatsApp's handshake implementation using Noise Protocol";
61     homepage = "https://github.com/tgalal/consonance";
62     license = lib.licenses.gpl3Plus;
63     maintainers = [ ];
64   };