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