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