1{
2 lib,
3 fetchFromGitHub,
4 buildPythonPackage,
5 pythonOlder,
6 pytestCheckHook,
7 rustPlatform,
8 stdenv,
9 py-bip39-bindings,
10 libiconv,
11}:
12
13buildPythonPackage rec {
14 pname = "py-sr25519-bindings";
15 version = "unstable-2023-03-15";
16 format = "pyproject";
17
18 disabled = pythonOlder "3.6";
19
20 src = fetchFromGitHub {
21 owner = "polkascan";
22 repo = "py-sr25519-bindings";
23 rev = "9127501235bf291d7f14f00ec373d0a5000a32cb";
24 hash = "sha256-mxNmiFvMbV9WQhGNIQXxTkOcJHYs0vyOPM6Nd5367RE=";
25 };
26
27 cargoDeps = rustPlatform.fetchCargoTarball {
28 inherit src;
29 name = "${pname}-${version}";
30 hash = "sha256-7fDlEYWOiRVpG3q0n3ZSS1dfNCOh0/4pX/PbcDBvoMI=";
31 };
32
33 nativeBuildInputs = with rustPlatform; [
34 cargoSetupHook
35 maturinBuildHook
36 ];
37
38 buildInputs = lib.optionals stdenv.hostPlatform.isDarwin [ libiconv ];
39
40 nativeCheckInputs = [
41 pytestCheckHook
42 py-bip39-bindings
43 ];
44
45 pytestFlagsArray = [ "tests.py" ];
46
47 pythonImportsCheck = [ "sr25519" ];
48
49 meta = with lib; {
50 description = "Python bindings for sr25519 library";
51 homepage = "https://github.com/polkascan/py-sr25519-bindings";
52 license = licenses.asl20;
53 maintainers = with maintainers; [
54 onny
55 stargate01
56 ];
57 };
58}