From a4cca84b0aeb441c65aa5b804f0aa15a0f640cc2 Mon Sep 17 00:00:00 2001 From: Luflosi Date: Tue, 9 Feb 2021 14:16:56 +0100 Subject: [PATCH] python3Packages.py-multicodec: init at 0.2.1 --- .../python-modules/py-multicodec/default.nix | 52 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 54 insertions(+) create mode 100644 pkgs/development/python-modules/py-multicodec/default.nix diff --git a/pkgs/development/python-modules/py-multicodec/default.nix b/pkgs/development/python-modules/py-multicodec/default.nix new file mode 100644 index 000000000000..c41da62cf4c5 --- /dev/null +++ b/pkgs/development/python-modules/py-multicodec/default.nix @@ -0,0 +1,52 @@ +{ lib +, buildPythonPackage +, fetchFromGitHub +, pytest-runner +, pytestCheckHook +, pythonOlder +, morphys +, six +, varint +}: + +buildPythonPackage rec { + pname = "py-multicodec"; + version = "0.2.1"; + disabled = pythonOlder "3.5"; + + src = fetchFromGitHub { + owner = "multiformats"; + repo = pname; + rev = "v${version}"; + sha256 = "sha256-2aK+bfhqCMqSO+mtrHIfNQmQpQHpwd7yHseI/3O7Sp4="; + }; + + # Error when not substituting: + # Failed: [pytest] section in setup.cfg files is no longer supported, change to [tool:pytest] instead. + postPatch = '' + substituteInPlace setup.cfg --replace "[pytest]" "[tool:pytest]" + ''; + + nativeBuildInputs = [ + pytest-runner + ]; + + propagatedBuildInputs = [ + varint + six + morphys + ]; + + checkInputs = [ + pytestCheckHook + ]; + + pythonImportsCheck = [ "multicodec" ]; + + meta = with lib; { + description = "Compact self-describing codecs"; + homepage = "https://github.com/multiformats/py-multicodec"; + license = licenses.mit; + maintainers = with maintainers; [ Luflosi ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index e019628d1e2b..08b8cb846756 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -5666,6 +5666,8 @@ in { py-multibase = callPackage ../development/python-modules/py-multibase { }; + py-multicodec = callPackage ../development/python-modules/py-multicodec { }; + py-multihash = callPackage ../development/python-modules/py-multihash { }; pymumble = callPackage ../development/python-modules/pymumble { };