1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 cached-property,
6 eth-typing,
7 eth-utils,
8 pytestCheckHook,
9 pythonAtLeast,
10 pythonOlder,
11 setuptools,
12 pydantic,
13}:
14
15buildPythonPackage rec {
16 pname = "py-ecc";
17 version = "8.0.0";
18 pyproject = true;
19 disabled = pythonOlder "3.8";
20
21 src = fetchFromGitHub {
22 owner = "ethereum";
23 repo = "py_ecc";
24 rev = "v${version}";
25 hash = "sha256-4nmmX4TuErHxIDrBi+Ppr+4vuE7dSeqf8OqOxtqb3sY=";
26 };
27
28 nativeBuildInputs = [ setuptools ];
29
30 propagatedBuildInputs = [
31 cached-property
32 eth-typing
33 eth-utils
34 ];
35
36 nativeCheckInputs = [
37 pytestCheckHook
38 pydantic
39 ];
40
41 disabledTests = lib.optionals (pythonAtLeast "3.12") [
42 # https://github.com/ethereum/py_ecc/issues/133
43 "test_FQ2_object"
44 "test_pairing_bilinearity_on_G1"
45 "test_pairing_bilinearity_on_G2"
46 "test_pairing_composit_check"
47 "test_pairing_is_non_degenerate"
48 "test_pairing_negative_G1"
49 "test_pairing_negative_G2"
50 "test_pairing_output_order"
51 "test_install_local_wheel"
52 ];
53
54 pythonImportsCheck = [ "py_ecc" ];
55
56 meta = with lib; {
57 changelog = "https://github.com/ethereum/py_ecc/blob/${src.rev}/CHANGELOG.rst";
58 description = "ECC pairing and bn_128 and bls12_381 curve operations";
59 homepage = "https://github.com/ethereum/py_ecc";
60 license = licenses.mit;
61 maintainers = [ ];
62 };
63}