summaryrefslogtreecommitdiffstats
path: root/pkgs/development/python-modules/black-macchiato/default.nix
blob: 8d6ac3ef510efbac1ee7ec9b3aba83bccb0539e1 (plain)
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,
  fetchFromGitHub,
  pytestCheckHook,
  black,
  fetchpatch,
  setuptools,
}:

buildPythonPackage (finalAttrs: {
  pname = "black-macchiato";
  version = "1.3.0";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "wbolster";
    repo = "black-macchiato";
    rev = finalAttrs.version;
    sha256 = "0lc9w50nlbmlzj44krk7kxcia202fhybbnwfh77xixlc7vb4rayl";
  };

  patches = [
    # fix empty multi-line string test
    (fetchpatch {
      url = "https://github.com/wbolster/black-macchiato/commit/d3243a1c95b5029b3ffa12417f0c587a2ba79bcd.patch";
      hash = "sha256-3m8U6c+1UCRy/Fkq6lk9LhwrFyE+q3GD2jnMA7N4ZJs=";
    })
  ];

  build-system = [ setuptools ];

  dependencies = [ black ];

  nativeCheckInputs = [
    pytestCheckHook
  ];

  pythonImportsCheck = [ "black" ];

  meta = {
    description = "This is a small utility built on top of the black Python code formatter to enable formatting of partial files";
    mainProgram = "black-macchiato";
    homepage = "https://github.com/wbolster/black-macchiato";
    license = lib.licenses.bsd3;
    maintainers = with lib.maintainers; [ jperras ];
  };
})