1{
2 lib,
3 stdenv,
4 buildPythonPackage,
5 fetchFromGitHub,
6 # install dependencies
7 pytest,
8 vcrpy,
9 # test dependencies
10 hatchling,
11 pytestCheckHook,
12 pytest-httpbin,
13 pytest-mock,
14 requests,
15}:
16
17buildPythonPackage rec {
18 pname = "pytest-recording";
19 version = "0.13.4";
20 pyproject = true;
21
22 src = fetchFromGitHub {
23 owner = "kiwicom";
24 repo = "pytest-recording";
25 tag = "v${version}";
26 hash = "sha256-S++MnI0GgpQxS6kFkt05kcE4JMW7jyFjJ3o7DhfYoVA=";
27 };
28
29 build-system = [ hatchling ];
30
31 buildInputs = [
32 pytest
33 ];
34
35 dependencies = [ vcrpy ];
36
37 __darwinAllowLocalNetworking = true;
38
39 nativeCheckInputs = [
40 pytestCheckHook
41 pytest-httpbin
42 pytest-mock
43 requests
44 ];
45
46 disabledTests = [
47 "test_block_network_with_allowed_hosts"
48 ]
49 ++ lib.optionals stdenv.hostPlatform.isDarwin [
50 # Missing socket.AF_NETLINK
51 "test_other_socket"
52 ];
53
54 enabledTestPaths = [ "tests" ];
55
56 pythonImportsCheck = [ "pytest_recording" ];
57
58 meta = {
59 description = "Pytest plugin that allows you recording of network interactions via VCR.py";
60 homepage = "https://github.com/kiwicom/pytest-recording";
61 license = lib.licenses.mit;
62 maintainers = with lib.maintainers; [ jbgosselin ];
63 };
64}