1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 furl,
6 hatchling,
7 jsonschema,
8 pytest-asyncio,
9 pytest-httpbin,
10 pytest-pook,
11 pytestCheckHook,
12 pythonOlder,
13 xmltodict,
14}:
15
16buildPythonPackage rec {
17 pname = "pook";
18 version = "2.1.3";
19 pyproject = true;
20
21 disabled = pythonOlder "3.8";
22
23 src = fetchFromGitHub {
24 owner = "h2non";
25 repo = "pook";
26 tag = "v${version}";
27 hash = "sha256-DDHaKsye28gxyorILulrLRBy/B9zV673jeVZ85uPZAo=";
28 };
29
30 nativeBuildInputs = [ hatchling ];
31
32 propagatedBuildInputs = [
33 furl
34 jsonschema
35 xmltodict
36 ];
37
38 nativeCheckInputs = [
39 pytest-asyncio
40 pytest-httpbin
41 pytest-pook
42 pytestCheckHook
43 ];
44
45 pythonImportsCheck = [ "pook" ];
46
47 disabledTests = [
48 # furl compat issue
49 "test_headers_not_matching"
50 ];
51
52 disabledTestPaths = [
53 # Don't test integrations
54 "tests/integration/"
55 # Tests require network access
56 "tests/unit/interceptors/"
57 ];
58
59 # Tests use sockets
60 __darwinAllowLocalNetworking = true;
61
62 meta = with lib; {
63 description = "HTTP traffic mocking and testing";
64 homepage = "https://github.com/h2non/pook";
65 changelog = "https://github.com/h2non/pook/blob/v${version}/History.rst";
66 license = with licenses; [ mit ];
67 maintainers = with maintainers; [ fab ];
68 };
69}