From 045041224424e129b7a9ae9f1759a3d731ecd19d Mon Sep 17 00:00:00 2001 From: Luflosi Date: Mon, 8 Feb 2021 21:39:56 +0100 Subject: [PATCH] python3Packages.py-multiaddr: init at 0.0.9 --- .../python-modules/py-multiaddr/default.nix | 51 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 53 insertions(+) create mode 100644 pkgs/development/python-modules/py-multiaddr/default.nix diff --git a/pkgs/development/python-modules/py-multiaddr/default.nix b/pkgs/development/python-modules/py-multiaddr/default.nix new file mode 100644 index 000000000000..24fa6975cc5e --- /dev/null +++ b/pkgs/development/python-modules/py-multiaddr/default.nix @@ -0,0 +1,51 @@ +{ lib +, buildPythonPackage +, fetchFromGitHub +, pythonOlder +, varint +, base58 +, netaddr +, idna +, py-cid +, py-multicodec +, pytestCheckHook +}: + +buildPythonPackage rec { + pname = "py-multiaddr"; + version = "0.0.9"; + disabled = pythonOlder "3.5"; + + src = fetchFromGitHub { + owner = "multiformats"; + repo = pname; + rev = "v${version}"; + sha256 = "sha256-cGM7iYQPP+UOkbTxRhzuED0pkcydFCO8vpx9wTc0/HI="; + }; + + postPatch = '' + substituteInPlace setup.py --replace "'pytest-runner'," "" + ''; + + propagatedBuildInputs = [ + varint + base58 + netaddr + idna + py-cid + py-multicodec + ]; + + checkInputs = [ + pytestCheckHook + ]; + + pythonImportsCheck = [ "multiaddr" ]; + + meta = with lib; { + description = "Composable and future-proof network addresses"; + homepage = "https://github.com/multiformats/py-multiaddr"; + license = with licenses; [ mit asl20 ]; + maintainers = with maintainers; [ Luflosi ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 276dc923acc6..3f1620c4e478 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -5688,6 +5688,8 @@ in { pymsteams = callPackage ../development/python-modules/pymsteams { }; + py-multiaddr = callPackage ../development/python-modules/py-multiaddr { }; + py-multibase = callPackage ../development/python-modules/py-multibase { }; py-multicodec = callPackage ../development/python-modules/py-multicodec { };