1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 python,
6 pythonOlder,
7 setuptools,
8}:
9
10buildPythonPackage rec {
11 pname = "findimports";
12 version = "2.4.0";
13 pyproject = true;
14
15 disabled = pythonOlder "3.7";
16
17 src = fetchFromGitHub {
18 owner = "mgedmin";
19 repo = "findimports";
20 rev = "refs/tags/${version}";
21 hash = "sha256-ar05DYSc/raYC1RJyLCxDYnd7Zjx20aczywlb6wc67Y=";
22 };
23
24 nativeBuildInputs = [ 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 mainProgram = "findimports";
40 homepage = "https://github.com/mgedmin/findimports";
41 changelog = "https://github.com/mgedmin/findimports/blob/${version}/CHANGES.rst";
42 license = with licenses; [
43 gpl2Only # or
44 gpl3Only
45 ];
46 maintainers = with maintainers; [ fab ];
47 };
48}