about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/python-modules/py-ecc/default.nix
blob: d7769ea4873d9f1a4652d919dbadd0a352224d5c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
{ lib
, buildPythonPackage
, fetchFromGitHub
, cached-property
, eth-typing
, eth-utils
, pytestCheckHook
, pythonAtLeast
, pythonOlder
, setuptools
}:

buildPythonPackage rec {
  pname = "py-ecc";
  version = "7.0.0";
  pyproject = true;
  disabled = pythonOlder "3.8";

  src = fetchFromGitHub {
    owner = "ethereum";
    repo = "py_ecc";
    rev = "v${version}";
    hash = "sha256-DKe+bI1GEzXg4Y4n5OA1/hWYz9L3X1AvaOFPEnCaAfs=";
  };

  nativeBuildInputs = [
    setuptools
  ];

  propagatedBuildInputs = [
    cached-property
    eth-typing
    eth-utils
  ];

  nativeCheckInputs = [
    pytestCheckHook
  ];

  disabledTests = lib.optionals (pythonAtLeast "3.12") [
    # https://github.com/ethereum/py_ecc/issues/133
    "test_FQ2_object"
    "test_pairing_bilinearity_on_G1"
    "test_pairing_bilinearity_on_G2"
    "test_pairing_composit_check"
    "test_pairing_is_non_degenerate"
    "test_pairing_negative_G1"
    "test_pairing_negative_G2"
    "test_pairing_output_order"
  ];

  pythonImportsCheck = [ "py_ecc" ];

  meta = with lib; {
    changelog = "https://github.com/ethereum/py_ecc/blob/${src.rev}/CHANGELOG.rst";
    description = "ECC pairing and bn_128 and bls12_381 curve operations";
    homepage = "https://github.com/ethereum/py_ecc";
    license = licenses.mit;
    maintainers = with maintainers; [ ];
  };
}