Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{ 2 lib, 3 buildPythonPackage, 4 fetchFromGitHub, 5 pythonOlder, 6 hatchling, 7 anyio, 8 httpcore, 9 httpx, 10 wsproto, 11 pytestCheckHook, 12 starlette, 13 trio, 14 uvicorn, 15}: 16 17buildPythonPackage rec { 18 pname = "httpx-ws"; 19 version = "0.6.0"; 20 pyproject = true; 21 22 disabled = pythonOlder "3.8"; 23 24 src = fetchFromGitHub { 25 owner = "frankie567"; 26 repo = "httpx-ws"; 27 rev = "refs/tags/v${version}"; 28 hash = "sha256-eDc21FiGHi98doS4Zbubb/MVw4IjQ1q496TFHCX4xB4="; 29 }; 30 31 # we don't need to use the hatch-regex-commit plugin 32 postPatch = '' 33 substituteInPlace pyproject.toml \ 34 --replace-fail 'source = "regex_commit"' "" \ 35 --replace-fail 'commit_extra_args = ["-e"]' "" \ 36 --replace-fail '"hatch-regex-commit"' "" \ 37 --replace-fail 'addopts = "--cov=httpx_ws/ --cov-report=term-missing"' "" 38 ''; 39 40 build-system = [ hatchling ]; 41 42 dependencies = [ 43 anyio 44 httpcore 45 httpx 46 wsproto 47 ]; 48 49 pythonImportsCheck = [ "httpx_ws" ]; 50 51 nativeCheckInputs = [ 52 pytestCheckHook 53 starlette 54 trio 55 uvicorn 56 ]; 57 58 disabledTestPaths = [ 59 # hang 60 "tests/test_api.py" 61 ]; 62 63 meta = with lib; { 64 description = "WebSocket support for HTTPX"; 65 homepage = "https://github.com/frankie567/httpx-ws"; 66 license = licenses.mit; 67 }; 68}