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.1"; 20 format = "pyproject"; 21 22 src = fetchFromGitHub { 23 owner = "kiwicom"; 24 repo = "pytest-recording"; 25 rev = "refs/tags/v${version}"; 26 hash = "sha256-HyV1wWYS/8p45mZxgA1XSChLCTYq5iOzBRqKXyZpwgo="; 27 }; 28 29 buildInputs = [ 30 hatchling 31 pytest 32 ]; 33 34 propagatedBuildInputs = [ vcrpy ]; 35 36 __darwinAllowLocalNetworking = true; 37 38 checkInputs = [ 39 pytestCheckHook 40 pytest-httpbin 41 pytest-mock 42 requests 43 ]; 44 45 disabledTests = 46 [ "test_block_network_with_allowed_hosts" ] 47 ++ lib.optionals stdenv.isDarwin [ 48 # Missing socket.AF_NETLINK 49 "test_other_socket" 50 ]; 51 52 pytestFlagsArray = [ "tests" ]; 53 54 pythonImportsCheck = [ "pytest_recording" ]; 55 56 meta = with lib; { 57 description = "A pytest plugin that allows you recording of network interactions via VCR.py"; 58 homepage = "https://github.com/kiwicom/pytest-recording"; 59 license = licenses.mit; 60 maintainers = with maintainers; [ jbgosselin ]; 61 }; 62}