about summary refs log tree commit diff
path: root/pkgs/development/python-modules/httpx-ws/default.nix
blob: fd02d918f04f497754634590981f4df2e45088b4 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
{
  lib,
  buildPythonPackage,
  fetchFromGitHub,
  pythonOlder,
  hatchling,
  anyio,
  httpcore,
  httpx,
  wsproto,
  pytestCheckHook,
  starlette,
  trio,
  uvicorn,
}:

buildPythonPackage rec {
  pname = "httpx-ws";
  version = "0.6.0";
  pyproject = true;

  disabled = pythonOlder "3.8";

  src = fetchFromGitHub {
    owner = "frankie567";
    repo = "httpx-ws";
    rev = "refs/tags/v${version}";
    hash = "sha256-eDc21FiGHi98doS4Zbubb/MVw4IjQ1q496TFHCX4xB4=";
  };

  # we don't need to use the hatch-regex-commit plugin
  postPatch = ''
    substituteInPlace pyproject.toml \
      --replace-fail 'source = "regex_commit"' "" \
      --replace-fail 'commit_extra_args = ["-e"]' "" \
      --replace-fail '"hatch-regex-commit"' "" \
      --replace-fail 'addopts = "--cov=httpx_ws/ --cov-report=term-missing"' ""
  '';

  build-system = [ hatchling ];

  dependencies = [
    anyio
    httpcore
    httpx
    wsproto
  ];

  pythonImportsCheck = [ "httpx_ws" ];

  nativeCheckInputs = [
    pytestCheckHook
    starlette
    trio
    uvicorn
  ];

  disabledTestPaths = [
    # hang
    "tests/test_api.py"
  ];

  meta = with lib; {
    description = "WebSocket support for HTTPX";
    homepage = "https://github.com/frankie567/httpx-ws";
    license = licenses.mit;
  };
}