1{ lib 2, buildPythonPackage 3, fetchFromGitHub 4, pythonOlder 5, python 6, py-multiaddr 7, requests 8, pytestCheckHook 9, pytest-cov 10, pytest-dependency 11, pytest-localserver 12, pytest-mock 13, pytest-order 14, pytest-cid 15, mock 16, ipfs 17, httpx 18, httpcore 19}: 20 21buildPythonPackage rec { 22 pname = "ipfshttpclient"; 23 version = "0.8.0a2"; 24 format = "flit"; 25 disabled = pythonOlder "3.6"; 26 27 src = fetchFromGitHub { 28 owner = "ipfs-shipyard"; 29 repo = "py-ipfs-http-client"; 30 rev = version; 31 sha256 = "sha256-OmC67pN2BbuGwM43xNDKlsLhwVeUbpvfOazyIDvoMEA="; 32 }; 33 34 propagatedBuildInputs = [ 35 py-multiaddr 36 requests 37 ]; 38 39 checkInputs = [ 40 pytestCheckHook 41 pytest-cov 42 pytest-dependency 43 pytest-localserver 44 pytest-mock 45 pytest-order 46 pytest-cid 47 mock 48 ipfs 49 httpcore 50 httpx 51 ]; 52 53 postPatch = '' 54 # This can be removed for the 0.8.0 release 55 # Use pytest-order instead of pytest-ordering since the latter is unmaintained and broken 56 substituteInPlace test/run-tests.py \ 57 --replace 'pytest_ordering' 'pytest_order' 58 substituteInPlace test/functional/test_miscellaneous.py \ 59 --replace '@pytest.mark.last' '@pytest.mark.order("last")' 60 ''; 61 62 checkPhase = '' 63 runHook preCheck 64 65 ${python.interpreter} -X utf8 test/run-tests.py 66 67 runHook postCheck 68 ''; 69 70 pythonImportsCheck = [ "ipfshttpclient" ]; 71 72 meta = with lib; { 73 description = "A python client library for the IPFS API"; 74 homepage = "https://github.com/ipfs-shipyard/py-ipfs-http-client"; 75 license = licenses.mit; 76 maintainers = with maintainers; [ mguentner Luflosi ]; 77 }; 78}