1{ lib
2, buildPythonPackage
3, fetchFromGitHub
4, flask
5, httpcore
6, httpx
7, pytest-asyncio
8, pytestCheckHook
9, pythonOlder
10, starlette
11, trio
12}:
13
14buildPythonPackage rec {
15 pname = "respx";
16 version = "0.20.2";
17 format = "setuptools";
18
19 disabled = pythonOlder "3.7";
20
21 src = fetchFromGitHub {
22 owner = "lundberg";
23 repo = pname;
24 rev = version;
25 hash = "sha256-OiBKNK8V9WNQDe29Q5+E/jjBWD0qFcYUzhYUWA+7oFc=";
26 };
27
28 propagatedBuildInputs = [
29 httpx
30 ];
31
32 nativeCheckInputs = [
33 httpcore
34 httpx
35 flask
36 pytest-asyncio
37 pytestCheckHook
38 starlette
39 trio
40 ];
41
42 postPatch = ''
43 sed -i "/--cov/d" setup.cfg
44 '';
45
46 disabledTests = [
47 "test_pass_through"
48 ];
49
50 pythonImportsCheck = [
51 "respx"
52 ];
53
54 meta = with lib; {
55 description = "Python library for mocking HTTPX";
56 homepage = "https://lundberg.github.io/respx/";
57 changelog = "https://github.com/lundberg/respx/blob/${version}/CHANGELOG.md";
58 license = with licenses; [ bsd3 ];
59 maintainers = with maintainers; [ fab ];
60 };
61}