1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 pytestCheckHook,
6 pythonOlder,
7 setuptools,
8 tokenize-rt,
9}:
10
11buildPythonPackage rec {
12 pname = "add-trailing-comma";
13 version = "3.2.0";
14 pyproject = true;
15
16 disabled = pythonOlder "3.9";
17
18 src = fetchFromGitHub {
19 owner = "asottile";
20 repo = "add-trailing-comma";
21 tag = "v${version}";
22 hash = "sha256-b9EHlx149NUAo9UHDZLE3BwSJY5WpxsUYi1mqz7rnHA=";
23 };
24
25 build-system = [ setuptools ];
26
27 dependencies = [ tokenize-rt ];
28
29 nativeCheckInputs = [ pytestCheckHook ];
30
31 pythonImportsCheck = [ "add_trailing_comma" ];
32
33 meta = with lib; {
34 description = "Tool (and pre-commit hook) to automatically add trailing commas to calls and literals";
35 homepage = "https://github.com/asottile/add-trailing-comma";
36 changelog = "https://github.com/asottile/add-trailing-comma/releases/tag/${src.tag}";
37 license = licenses.mit;
38 maintainers = with maintainers; [ gador ];
39 mainProgram = "add-trailing-comma";
40 };
41}