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