1{ 2 lib, 3 buildPythonPackage, 4 fetchpatch, 5 fetchPypi, 6 parameterized, 7 pytestCheckHook, 8 pynose, 9 python, 10 pythonOlder, 11 setuptools, 12}: 13 14buildPythonPackage rec { 15 pname = "pprintpp"; 16 version = "0.4.0"; 17 pyproject = true; 18 19 disabled = pythonOlder "3.7"; 20 21 src = fetchPypi { 22 inherit pname version; 23 hash = "sha256-6oJhCOLH9J3G1mx1KXPD/JdJFCp5jWslTh4wHP28ZAM="; 24 }; 25 26 patches = [ 27 # Replace nose-parameterized with parameterized, https://github.com/wolever/pprintpp/pull/21 28 (fetchpatch { 29 url = "https://github.com/wolever/pprintpp/commit/873217674cc824b4c1cfdad4867c560c60e8d806.patch"; 30 hash = "sha256-Y+2yVUkDHkwo49ynNHYXVXJpX4DfVYJ0CWKgzFX/HWc="; 31 }) 32 # Remove "U" move from open(), https://github.com/wolever/pprintpp/pull/31 33 (fetchpatch { 34 name = "remove-u.patch"; 35 url = "https://github.com/wolever/pprintpp/commit/deec5e5efad562fc2f9084abfe249ed0c7dd65fa.patch"; 36 hash = "sha256-I84pnY/KyCIPPI9q0uvj64t8oPeMkgVTPEBRANkZNa4="; 37 }) 38 ]; 39 40 build-system = [ setuptools ]; 41 42 nativeCheckInputs = [ 43 parameterized 44 pynose 45 pytestCheckHook 46 ]; 47 48 pythonImportsCheck = [ "pprintpp" ]; 49 50 pytestFlagsArray = [ "test.py" ]; 51 52 disabledTests = [ 53 # AttributeError: 'EncodedFile' object has no attribute 'getvalue' 54 "test_pp" 55 "test_pp_pprint" 56 "test_fmt" 57 ]; 58 59 meta = with lib; { 60 description = "A drop-in replacement for pprint that's actually pretty"; 61 homepage = "https://github.com/wolever/pprintpp"; 62 changelog = "https://github.com/wolever/pprintpp/blob/${version}/CHANGELOG.txt"; 63 license = licenses.bsd2; 64 maintainers = with maintainers; [ jakewaksbaum ]; 65 mainProgram = "pypprint"; 66 }; 67}