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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
|
{
lib,
buildPythonPackage,
fetchFromGitHub,
pytestCheckHook,
# Python deps
blockfrost-python,
cachetools,
cbor2,
cose,
docker,
ecpy,
frozendict,
frozenlist,
mnemonic,
ogmios,
poetry-core,
pprintpp,
pynacl,
requests,
setuptools,
typeguard,
websocket-client,
websockets,
}:
let
cose_0_9_dev8 = (cose.override { inherit cbor2; }).overridePythonAttrs (old: rec {
version = "0.9.dev8";
src = (
old.src.override {
rev = "v${version}";
hash = "sha256-/jwq2C2nvHInsgPG4jZCr+XsvlUJdYewAkasrUPVaHM=";
}
);
pythonImportsCheck = [ "cose" ];
});
in
buildPythonPackage rec {
pname = "pycardano";
version = "0.14.0";
pyproject = true;
src = fetchFromGitHub {
owner = "Python-Cardano";
repo = "pycardano";
tag = "v${version}";
hash = "sha256-W5N254tND7mI0oR82YhMFWn4zVVs3ygYOqXOBMO3sXY=";
};
build-system = [
setuptools
];
dependencies = [
blockfrost-python
cachetools
cbor2
cose_0_9_dev8
docker
ecpy
frozendict
frozenlist
mnemonic
ogmios
poetry-core
pprintpp
pynacl
requests
typeguard
websocket-client
websockets
];
nativeCheckInputs = [
pytestCheckHook
];
pythonRelaxDeps = [
"ogmios"
"websockets"
];
pythonImportsCheck = [ "pycardano" ];
meta = {
description = "Lightweight Cardano library in Python";
homepage = "https://github.com/Python-Cardano/pycardano";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ aciceri ];
# https://github.com/Python-Cardano/pycardano/blob/v0.13.2/Makefile#L26-L39
# cbor2 with C extensions fail tests due to differences in used sized vs unsized arrays
# more info: https://github.com/NixOS/nixpkgs/pull/402433#issuecomment-2916520286
broken = cbor2.withCExtensions; # consider overriding cbor2 with cbor2WithoutCExtensions
};
}
|