1{ lib
2, buildPythonPackage
3, fetchPypi
4, hatchling
5, pyflakes
6, pytestCheckHook
7, pythonOlder
8, tomli
9}:
10buildPythonPackage rec {
11 pname = "autoflake";
12 version = "2.2.1";
13 format = "pyproject";
14
15 src = fetchPypi {
16 inherit pname version;
17 hash = "sha256-Yre2RJppLDybDJFpGbvCFkjacoHoUGvPjT+CgOQx68E=";
18 };
19
20 nativeBuildInputs = [
21 hatchling
22 ];
23
24 propagatedBuildInputs = [
25 pyflakes
26 ]
27 ++ lib.optional (pythonOlder "3.11") tomli;
28
29 nativeCheckInputs = [
30 pytestCheckHook
31 ];
32
33 pythonImportsCheck = [
34 "autoflake"
35 ];
36
37 disabledTests = [
38 # AssertionError: True is not false
39 "test_is_literal_or_name"
40 ];
41
42 meta = with lib; {
43 description = "Tool to remove unused imports and unused variables";
44 homepage = "https://github.com/myint/autoflake";
45 license = licenses.mit;
46 maintainers = with maintainers; [ yuriaisaka ];
47 };
48}