about summary refs log tree commit diff
path: root/pkgs/development/python-modules/pprintpp/default.nix
blob: d791e77972b9c09762d1fb15706651360babe324 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
{
  lib,
  buildPythonPackage,
  fetchpatch,
  fetchFromGitHub,
  pytestCheckHook,
  pythonOlder,
  setuptools,
}:

buildPythonPackage rec {
  pname = "pprintpp";
  version = "0.4.0-unstable-2022-05-31";
  pyproject = true;

  disabled = pythonOlder "3.7";

  src = fetchFromGitHub {
    owner = "joaonc";
    repo = "pprintpp2";
    rev = "303f0652c9420f2cf0a0f4fe1907377508a17b3d"; # no tags
    hash = "sha256-rjOf38m5mzIyJ3aVrD0+WQuzIyFjfa/4zmpFGGhF2hs=";
  };

  patches = [
    # Remove "U" move from open(), https://github.com/wolever/pprintpp/pull/31
    (fetchpatch {
      name = "remove-u.patch";
      url = "https://github.com/wolever/pprintpp/commit/deec5e5efad562fc2f9084abfe249ed0c7dd65fa.patch";
      hash = "sha256-I84pnY/KyCIPPI9q0uvj64t8oPeMkgVTPEBRANkZNa4=";
    })
  ];

  build-system = [ setuptools ];

  pythonImportsCheck = [ "pprintpp" ];

  nativeCheckInputs = [ pytestCheckHook ];

  meta = with lib; {
    description = "Drop-in replacement for pprint that's actually pretty";
    homepage = "https://github.com/wolever/pprintpp";
    changelog = "https://github.com/wolever/pprintpp/blob/${version}/CHANGELOG.txt";
    license = licenses.bsd2;
    maintainers = with maintainers; [ jakewaksbaum ];
    mainProgram = "pypprint";
  };
}