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