1{ 2 lib, 3 atomicwrites, 4 buildPythonPackage, 5 fetchFromGitHub, 6 #, hatchling 7 ruamel-yaml, 8 poetry-core, 9 pytest, 10 pytest-asyncio, 11 pytestCheckHook, 12 pythonOlder, 13 pythonRelaxDepsHook, 14 testfixtures, 15}: 16 17buildPythonPackage rec { 18 pname = "pytest-golden"; 19 version = "0.2.2"; 20 format = "pyproject"; 21 22 disabled = pythonOlder "3.7"; 23 24 src = fetchFromGitHub { 25 owner = "oprypin"; 26 repo = pname; 27 rev = "refs/tags/v${version}"; 28 hash = "sha256-l5fXWDK6gWJc3dkYFTokI9tWvawMRnF0td/lSwqkYXE="; 29 }; 30 31 postPatch = '' 32 substituteInPlace pyproject.toml \ 33 --replace "poetry>=0.12" poetry-core \ 34 --replace poetry.masonry.api poetry.core.masonry.api 35 ''; 36 37 pythonRelaxDeps = [ "testfixtures" ]; 38 39 nativeBuildInputs = [ 40 # hatchling used for > 0.2.2 41 poetry-core 42 pythonRelaxDepsHook 43 ]; 44 45 buildInputs = [ pytest ]; 46 47 propagatedBuildInputs = [ 48 atomicwrites 49 ruamel-yaml 50 testfixtures 51 ]; 52 53 nativeCheckInputs = [ 54 pytest-asyncio 55 pytestCheckHook 56 ]; 57 58 pythonImportsCheck = [ "pytest_golden" ]; 59 60 meta = with lib; { 61 description = "Plugin for pytest that offloads expected outputs to data files"; 62 homepage = "https://github.com/oprypin/pytest-golden"; 63 license = licenses.mit; 64 maintainers = with maintainers; [ fab ]; 65 }; 66}