1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 python,
6 pythonOlder,
7 setuptools,
8}:
9
10buildPythonPackage rec {
11 pname = "findimports";
12 version = "2.6.0";
13 pyproject = true;
14
15 disabled = pythonOlder "3.7";
16
17 src = fetchFromGitHub {
18 owner = "mgedmin";
19 repo = "findimports";
20 tag = version;
21 hash = "sha256-2hhonlv7FF4s+wDOsBGnLsMxJEXlMlNbLEkI8HptyOI=";
22 };
23
24 build-system = [ setuptools ];
25
26 pythonImportsCheck = [ "findimports" ];
27
28 checkPhase = ''
29 # Tests fails
30 rm tests/cmdline.txt
31
32 runHook preCheck
33 ${python.interpreter} testsuite.py
34 runHook postCheck
35 '';
36
37 meta = with lib; {
38 description = "Module for the analysis of Python import statements";
39 homepage = "https://github.com/mgedmin/findimports";
40 changelog = "https://github.com/mgedmin/findimports/blob/${version}/CHANGES.rst";
41 license = with licenses; [
42 gpl2Only # or
43 gpl3Only
44 ];
45 maintainers = with maintainers; [ fab ];
46 mainProgram = "findimports";
47 };
48}