summaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules/findimports/default.nix
blob: 7bb873cffe69ce0d148f7a4674e0f2c5f953bd7f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
{
  lib,
  buildPythonPackage,
  fetchFromGitHub,
  python,
  setuptools,
}:

buildPythonPackage rec {
  pname = "findimports";
  version = "2.7.0";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "mgedmin";
    repo = "findimports";
    tag = version;
    hash = "sha256-ztbf9F1tz5EhqSkE8W6i7ihJYJTymKQdXI+K/G7DbHM=";
  };

  build-system = [ setuptools ];

  pythonImportsCheck = [ "findimports" ];

  checkPhase = ''
    # Tests fails
    rm tests/cmdline.txt

    runHook preCheck
    ${python.interpreter} testsuite.py
    runHook postCheck
  '';

  meta = {
    description = "Module for the analysis of Python import statements";
    homepage = "https://github.com/mgedmin/findimports";
    changelog = "https://github.com/mgedmin/findimports/blob/${src.tag}/CHANGES.rst";
    license = with lib.licenses; [
      gpl2Only # or
      gpl3Only
    ];
    maintainers = with lib.maintainers; [ fab ];
    mainProgram = "findimports";
  };
}