ocamlPackages.hxd: 0.3.2 -> 0.3.3 (#364231)
[NixPkgs.git] / pkgs / development / python-modules / ipfshttpclient / default.nix
blob263870816dabac3f49058bdd65bec1e60fb2f66f
2   lib,
3   buildPythonPackage,
4   fetchFromGitHub,
5   flit-core,
6   pythonOlder,
7   python,
8   py-multiaddr,
9   requests,
10   pytestCheckHook,
11   pytest-cov-stub,
12   pytest-dependency,
13   pytest-localserver,
14   pytest-mock,
15   pytest-order,
16   pytest-cid,
17   mock,
18   kubo,
19   httpx,
20   httpcore,
23 buildPythonPackage rec {
24   pname = "ipfshttpclient";
25   version = "0.8.0a2";
26   format = "pyproject";
27   disabled = pythonOlder "3.6";
29   src = fetchFromGitHub {
30     owner = "ipfs-shipyard";
31     repo = "py-ipfs-http-client";
32     rev = version;
33     hash = "sha256-OmC67pN2BbuGwM43xNDKlsLhwVeUbpvfOazyIDvoMEA=";
34   };
36   nativeBuildInputs = [ flit-core ];
38   propagatedBuildInputs = [
39     py-multiaddr
40     requests
41   ];
43   nativeCheckInputs = [
44     pytestCheckHook
45     pytest-cov-stub
46     pytest-dependency
47     pytest-localserver
48     pytest-mock
49     pytest-order
50     pytest-cid
51     mock
52     kubo
53     httpcore
54     httpx
55   ];
57   postPatch = ''
58     # This can be removed for the 0.8.0 release
59     # Use pytest-order instead of pytest-ordering since the latter is unmaintained and broken
60     substituteInPlace test/run-tests.py \
61       --replace 'pytest_ordering' 'pytest_order'
62     substituteInPlace test/functional/test_miscellaneous.py \
63       --replace '@pytest.mark.last' '@pytest.mark.order("last")'
65     # Until a proper fix is created, just skip these tests
66     # and ignore any breakage that may result from the API change in IPFS
67     # See https://github.com/ipfs-shipyard/py-ipfs-http-client/issues/308
68     substituteInPlace test/functional/test_pubsub.py \
69       --replace '# the message that will be published' 'pytest.skip("This test fails because of an incompatibility with the experimental PubSub feature in IPFS>=0.11.0")' \
70       --replace '# subscribe to the topic testing'     'pytest.skip("This test fails because of an incompatibility with the experimental PubSub feature in IPFS>=0.11.0")'
71     substituteInPlace test/functional/test_other.py \
72       --replace 'import ipfshttpclient' 'import ipfshttpclient; import pytest' \
73       --replace 'assert ipfs_is_available' 'pytest.skip("Unknown test failure with IPFS >=0.11.0"); assert ipfs_is_available'
74     substituteInPlace test/run-tests.py \
75       --replace '--cov-fail-under=90' '--cov-fail-under=75'
76   '';
78   checkPhase = ''
79     runHook preCheck
81     ${python.interpreter} -X utf8 test/run-tests.py
83     runHook postCheck
84   '';
86   doCheck = false;
88   pythonImportsCheck = [ "ipfshttpclient" ];
90   meta = with lib; {
91     description = "Python client library for the IPFS API";
92     homepage = "https://github.com/ipfs-shipyard/py-ipfs-http-client";
93     license = licenses.mit;
94     maintainers = with maintainers; [
95       mguentner
96       Luflosi
97     ];
98   };