about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/python-modules/respx/default.nix
blob: 61e2016a4975be5ba477787d2728067f0dfb069a (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
{ lib
, attrs
, buildPythonPackage
, fetchFromGitHub
, httpcore
, httpx
, pytest-asyncio
, pytest-cov
, pytestCheckHook
, trio
, xmltodict
}:

buildPythonPackage rec {
  pname = "respx";
  version = "0.16.3";

  src = fetchFromGitHub {
    owner = "lundberg";
    repo = pname;
    rev = version;
    sha256 = "0if9sg83rznl37hsjw6pfk78jpxi421g9p21wd92jcd6073g4nbd";
  };

  # Coverage is under 100 % due to the excluded tests
  postPatch = ''
    substituteInPlace setup.cfg --replace "--cov-fail-under 100" ""
  '';

  propagatedBuildInputs = [ httpx ];

  checkInputs = [
    httpcore
    httpx
    pytest-asyncio
    pytest-cov
    pytestCheckHook
    trio
  ];

  disabledTests = [ "test_pass_through" ];
  pythonImportsCheck = [ "respx" ];

  meta = with lib; {
    description = "Python library for mocking HTTPX";
    homepage = "https://lundberg.github.io/respx/";
    license = with licenses; [ bsd3 ];
    maintainers = with maintainers; [ fab ];
  };
}