1{ lib
2, buildPythonPackage
3, fetchFromGitHub
4, pythonOlder
5, pytestCheckHook
6, base58
7, py-multibase
8, py-multicodec
9, morphys
10, py-multihash
11, hypothesis
12}:
13
14buildPythonPackage rec {
15 pname = "py-cid";
16 version = "0.3.0";
17 disabled = pythonOlder "3.5";
18
19 src = fetchFromGitHub {
20 owner = "ipld";
21 repo = pname;
22 rev = "v${version}";
23 hash = "sha256-aN7ee25ghKKa90+FoMDCdGauToePc5AzDLV3tONvh4U=";
24 };
25
26 postPatch = ''
27 substituteInPlace setup.py \
28 --replace "base58>=1.0.2,<2.0" "base58>=1.0.2" \
29 --replace "py-multihash>=0.2.0,<1.0.0" "py-multihash>=0.2.0" \
30 --replace "'pytest-runner'," ""
31 '';
32
33 propagatedBuildInputs = [
34 base58
35 py-multibase
36 py-multicodec
37 morphys
38 py-multihash
39 ];
40
41 nativeCheckInputs = [
42 pytestCheckHook
43 hypothesis
44 ];
45
46 pythonImportsCheck = [ "cid" ];
47
48 meta = with lib; {
49 description = "Self-describing content-addressed identifiers for distributed systems implementation in Python";
50 homepage = "https://github.com/ipld/py-cid";
51 license = licenses.mit;
52 maintainers = with maintainers; [ Luflosi ];
53 };
54}