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