From 74a5c3bebae89e96d9a249cffdf90e842ba21106 Mon Sep 17 00:00:00 2001 From: Luflosi Date: Tue, 9 Feb 2021 01:46:23 +0100 Subject: [PATCH] python3Packages.py-cid: init at 0.3.0 --- .../python-modules/py-cid/default.nix | 54 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 56 insertions(+) create mode 100644 pkgs/development/python-modules/py-cid/default.nix diff --git a/pkgs/development/python-modules/py-cid/default.nix b/pkgs/development/python-modules/py-cid/default.nix new file mode 100644 index 000000000000..86c2e80601f6 --- /dev/null +++ b/pkgs/development/python-modules/py-cid/default.nix @@ -0,0 +1,54 @@ +{ lib +, buildPythonPackage +, fetchFromGitHub +, pythonOlder +, pytestCheckHook +, base58 +, py-multibase +, py-multicodec +, morphys +, py-multihash +, hypothesis +}: + +buildPythonPackage rec { + pname = "py-cid"; + version = "0.3.0"; + disabled = pythonOlder "3.5"; + + src = fetchFromGitHub { + owner = "ipld"; + repo = pname; + rev = "v${version}"; + sha256 = "sha256-aN7ee25ghKKa90+FoMDCdGauToePc5AzDLV3tONvh4U="; + }; + + postPatch = '' + substituteInPlace setup.py \ + --replace "base58>=1.0.2,<2.0" "base58>=1.0.2" \ + --replace "py-multihash>=0.2.0,<1.0.0" "py-multihash>=0.2.0" \ + --replace "'pytest-runner'," "" + ''; + + propagatedBuildInputs = [ + base58 + py-multibase + py-multicodec + morphys + py-multihash + ]; + + checkInputs = [ + pytestCheckHook + hypothesis + ]; + + pythonImportsCheck = [ "cid" ]; + + meta = with lib; { + description = "Self-describing content-addressed identifiers for distributed systems implementation in Python"; + homepage = "https://github.com/ipld/py-cid"; + license = licenses.mit; + maintainers = with maintainers; [ Luflosi ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 17f6624c42ea..519de9f53b67 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -5315,6 +5315,8 @@ in { pycparser = callPackage ../development/python-modules/pycparser { }; + py-cid = callPackage ../development/python-modules/py-cid { }; + py-cpuinfo = callPackage ../development/python-modules/py-cpuinfo { }; pycrc = callPackage ../development/python-modules/pycrc { };