Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
at domenkozar-patch-1 77 lines 1.3 kB view raw
1{ lib 2, anyio 3, buildPythonPackage 4, certifi 5, fetchFromGitHub 6, h11 7, h2 8, pproxy 9, pytest-asyncio 10, pytest-httpbin 11, pytest-trio 12, pytestCheckHook 13, pythonOlder 14, sniffio 15, socksio 16}: 17 18buildPythonPackage rec { 19 pname = "httpcore"; 20 version = "0.16.2"; 21 format = "setuptools"; 22 23 disabled = pythonOlder "3.7"; 24 25 src = fetchFromGitHub { 26 owner = "encode"; 27 repo = pname; 28 rev = version; 29 hash = "sha256-bwGZ/B0jlvc1BmXVTo7gMP6PJIQuCHclkHjKQCgMsyU="; 30 }; 31 32 propagatedBuildInputs = [ 33 anyio 34 certifi 35 h11 36 sniffio 37 ]; 38 39 passthru.optional-dependencies = { 40 http2 = [ 41 h2 42 ]; 43 socks = [ 44 socksio 45 ]; 46 }; 47 48 checkInputs = [ 49 pproxy 50 pytest-asyncio 51 pytest-httpbin 52 pytest-trio 53 pytestCheckHook 54 ] ++ passthru.optional-dependencies.http2 55 ++ passthru.optional-dependencies.socks; 56 57 pythonImportsCheck = [ 58 "httpcore" 59 ]; 60 61 preCheck = '' 62 # remove upstreams pytest flags which cause: 63 # httpcore.ConnectError: TLS/SSL connection has been closed (EOF) (_ssl.c:997) 64 rm setup.cfg 65 ''; 66 67 pytestFlagsArray = [ 68 "--asyncio-mode=strict" 69 ]; 70 71 meta = with lib; { 72 description = "A minimal low-level HTTP client"; 73 homepage = "https://github.com/encode/httpcore"; 74 license = licenses.bsd3; 75 maintainers = with maintainers; [ ris ]; 76 }; 77}