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