1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 pythonOlder,
6 varint,
7 base58,
8 netaddr,
9 idna,
10 py-cid,
11 py-multicodec,
12 pytestCheckHook,
13}:
14
15buildPythonPackage rec {
16 pname = "py-multiaddr";
17 version = "0.0.10";
18 format = "setuptools";
19 disabled = pythonOlder "3.5";
20
21 src = fetchFromGitHub {
22 owner = "multiformats";
23 repo = "py-multiaddr";
24 tag = "v${version}";
25 hash = "sha256-N46D2H3RG6rtdBrSyDjh8UxD+Ph/FXEa4FcEI2uz4y8=";
26 };
27
28 postPatch = ''
29 substituteInPlace setup.py --replace "'pytest-runner'," ""
30 '';
31
32 propagatedBuildInputs = [
33 varint
34 base58
35 netaddr
36 idna
37 py-cid
38 py-multicodec
39 ];
40
41 nativeCheckInputs = [ pytestCheckHook ];
42
43 pythonImportsCheck = [ "multiaddr" ];
44
45 meta = with lib; {
46 description = "Composable and future-proof network addresses";
47 homepage = "https://github.com/multiformats/py-multiaddr";
48 license = with licenses; [
49 mit
50 asl20
51 ];
52 maintainers = with maintainers; [ Luflosi ];
53 };
54}