about summary refs log tree commit diff
path: root/pkgs/development/python-modules/pylama/default.nix
blob: 112d9392d80d5266d0c53f081e5c3fcaae9619d0 (plain) (blame)
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
{
  lib,
  buildPythonPackage,
  fetchFromGitHub,
  substituteAll,
  git,
  eradicate,
  mccabe,
  mypy,
  pycodestyle,
  pydocstyle,
  pyflakes,
  vulture,
  setuptools,
  pylint,
  pytestCheckHook,
}:

let
  pylama = buildPythonPackage rec {
    pname = "pylama";
    version = "8.4.1";

    format = "setuptools";

    src = fetchFromGitHub {
      name = "${pname}-${version}-source";
      owner = "klen";
      repo = "pylama";
      rev = version;
      hash = "sha256-WOGtZ412tX3YH42JCd5HIngunluwtMmQrOSUZp23LPU=";
    };

    patches = [
      (substituteAll {
        src = ./paths.patch;
        git = "${lib.getBin git}/bin/git";
      })
    ];

    propagatedBuildInputs = [
      eradicate
      mccabe
      mypy
      pycodestyle
      pydocstyle
      pyflakes
      setuptools
      vulture
    ];

    # escape infinite recursion pylint -> isort -> pylama
    doCheck = false;

    nativeCheckInputs = [
      pylint
      pytestCheckHook
    ];

    preCheck = ''
      export HOME=$TEMP
    '';

    disabledTests = [
      "test_quotes" # FIXME package pylama-quotes
      "test_radon" # FIXME package radon
    ];

    pythonImportsCheck = [ "pylama.main" ];

    passthru.tests = {
      check = pylama.overridePythonAttrs (_: {
        doCheck = true;
      });
    };

    meta = with lib; {
      description = "Code audit tool for python";
      mainProgram = "pylama";
      homepage = "https://github.com/klen/pylama";
      changelog = "https://github.com/klen/pylama/blob/${version}/Changelog";
      license = licenses.mit;
      maintainers = with maintainers; [ dotlambda ];
    };
  };
in
pylama