1{
2 lib,
3 buildPythonPackage,
4 fetchPypi,
5 pint,
6 pytestCheckHook,
7 pythonOlder,
8 setuptools,
9 toml,
10 tomli,
11}:
12
13buildPythonPackage rec {
14 pname = "vulture";
15 version = "2.11";
16 pyproject = true;
17
18 disabled = pythonOlder "3.8";
19
20 src = fetchPypi {
21 inherit pname version;
22 hash = "sha256-8Pu2C85lEarYfuBzbFAkVnN0kKgtkZpE5tkiYss18cI=";
23 };
24
25 postPatch = ''
26 substituteInPlace setup.cfg \
27 --replace " --cov vulture --cov-report=html --cov-report=term --cov-report=xml --cov-append" ""
28 '';
29
30 nativeBuildInputs = [ setuptools ];
31
32 propagatedBuildInputs = lib.optionals (pythonOlder "3.11") [ tomli ];
33
34 nativeCheckInputs = [
35 pint
36 pytestCheckHook
37 toml
38 ];
39
40 pythonImportsCheck = [ "vulture" ];
41
42 meta = with lib; {
43 description = "Finds unused code in Python programs";
44 mainProgram = "vulture";
45 homepage = "https://github.com/jendrikseipp/vulture";
46 changelog = "https://github.com/jendrikseipp/vulture/releases/tag/v${version}";
47 license = licenses.mit;
48 maintainers = with maintainers; [ mcwitt ];
49 };
50}