1{
2 lib,
3 buildPythonPackage,
4 fetchpatch,
5 fetchFromGitHub,
6 pytestCheckHook,
7 pythonOlder,
8 setuptools,
9}:
10
11buildPythonPackage rec {
12 pname = "pprintpp";
13 version = "0.4.0-unstable-2022-05-31";
14 pyproject = true;
15
16 disabled = pythonOlder "3.7";
17
18 src = fetchFromGitHub {
19 owner = "joaonc";
20 repo = "pprintpp2";
21 rev = "303f0652c9420f2cf0a0f4fe1907377508a17b3d"; # no tags
22 hash = "sha256-rjOf38m5mzIyJ3aVrD0+WQuzIyFjfa/4zmpFGGhF2hs=";
23 };
24
25 patches = [
26 # Remove "U" move from open(), https://github.com/wolever/pprintpp/pull/31
27 (fetchpatch {
28 name = "remove-u.patch";
29 url = "https://github.com/wolever/pprintpp/commit/deec5e5efad562fc2f9084abfe249ed0c7dd65fa.patch";
30 hash = "sha256-I84pnY/KyCIPPI9q0uvj64t8oPeMkgVTPEBRANkZNa4=";
31 })
32 ];
33
34 build-system = [ setuptools ];
35
36 pythonImportsCheck = [ "pprintpp" ];
37
38 nativeCheckInputs = [ pytestCheckHook ];
39
40 meta = with lib; {
41 description = "Drop-in replacement for pprint that's actually pretty";
42 homepage = "https://github.com/wolever/pprintpp";
43 changelog = "https://github.com/wolever/pprintpp/blob/${version}/CHANGELOG.txt";
44 license = licenses.bsd2;
45 maintainers = with maintainers; [ jakewaksbaum ];
46 mainProgram = "pypprint";
47 };
48}