1{ lib
2, buildPythonPackage
3, fetchFromGitHub
4, pythonOlder
5, varint
6, base58
7, netaddr
8, idna
9, py-cid
10, py-multicodec
11, pytestCheckHook
12}:
13
14buildPythonPackage rec {
15 pname = "py-multiaddr";
16 version = "0.0.9";
17 disabled = pythonOlder "3.5";
18
19 src = fetchFromGitHub {
20 owner = "multiformats";
21 repo = pname;
22 rev = "v${version}";
23 hash = "sha256-cGM7iYQPP+UOkbTxRhzuED0pkcydFCO8vpx9wTc0/HI=";
24 };
25
26 postPatch = ''
27 substituteInPlace setup.py --replace "'pytest-runner'," ""
28 '';
29
30 propagatedBuildInputs = [
31 varint
32 base58
33 netaddr
34 idna
35 py-cid
36 py-multicodec
37 ];
38
39 nativeCheckInputs = [
40 pytestCheckHook
41 ];
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; [ mit asl20 ];
49 maintainers = with maintainers; [ Luflosi ];
50 };
51}