nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 pytestCheckHook,
6 black,
7 fetchpatch,
8}:
9
10buildPythonPackage rec {
11 pname = "black-macchiato";
12 version = "1.3.0";
13 format = "setuptools";
14
15 src = fetchFromGitHub {
16 owner = "wbolster";
17 repo = "black-macchiato";
18 rev = version;
19 sha256 = "0lc9w50nlbmlzj44krk7kxcia202fhybbnwfh77xixlc7vb4rayl";
20 };
21
22 patches = [
23 # fix empty multi-line string test
24 (fetchpatch {
25 url = "https://github.com/wbolster/black-macchiato/commit/d3243a1c95b5029b3ffa12417f0c587a2ba79bcd.patch";
26 hash = "sha256-3m8U6c+1UCRy/Fkq6lk9LhwrFyE+q3GD2jnMA7N4ZJs=";
27 })
28 ];
29
30 propagatedBuildInputs = [ black ];
31
32 nativeCheckInputs = [
33 pytestCheckHook
34 black
35 ];
36
37 pythonImportsCheck = [ "black" ];
38
39 meta = {
40 description = "This is a small utility built on top of the black Python code formatter to enable formatting of partial files";
41 mainProgram = "black-macchiato";
42 homepage = "https://github.com/wbolster/black-macchiato";
43 license = lib.licenses.bsd3;
44 maintainers = with lib.maintainers; [ jperras ];
45 };
46}