1{
2 lib,
3 black,
4 buildPythonPackage,
5 click,
6 fetchFromGitHub,
7 flit-core,
8 libcst,
9 moreorless,
10 pythonOlder,
11 tomlkit,
12 trailrunner,
13 typing-extensions,
14 unittestCheckHook,
15 usort,
16}:
17
18buildPythonPackage rec {
19 pname = "ufmt";
20 version = "2.1.0";
21 format = "pyproject";
22
23 disabled = pythonOlder "3.7";
24
25 src = fetchFromGitHub {
26 owner = "omnilib";
27 repo = "ufmt";
28 rev = "refs/tags/v${version}";
29 hash = "sha256-eQIbSC0Oxi6JD7/3o2y9f+KhT8GIiFiYiV4A3QBoWl0=";
30 };
31
32 nativeBuildInputs = [ flit-core ];
33
34 propagatedBuildInputs = [
35 black
36 click
37 libcst
38 moreorless
39 tomlkit
40 trailrunner
41 typing-extensions
42 usort
43 ];
44
45 nativeCheckInputs = [ unittestCheckHook ];
46
47 pythonImportsCheck = [ "ufmt" ];
48
49 meta = with lib; {
50 description = "Safe, atomic formatting with black and usort";
51 mainProgram = "ufmt";
52 homepage = "https://github.com/omnilib/ufmt";
53 changelog = "https://github.com/omnilib/ufmt/blob/${version}/CHANGELOG.md";
54 license = licenses.mit;
55 maintainers = with maintainers; [ fab ];
56 };
57}