1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 substituteAll,
6 git,
7 eradicate,
8 mccabe,
9 mypy,
10 pycodestyle,
11 pydocstyle,
12 pyflakes,
13 vulture,
14 setuptools,
15 isort,
16 pylint,
17 pytestCheckHook,
18}:
19
20let
21 pylama = buildPythonPackage rec {
22 pname = "pylama";
23 version = "8.4.1";
24
25 format = "setuptools";
26
27 src = fetchFromGitHub {
28 name = "${pname}-${version}-source";
29 owner = "klen";
30 repo = "pylama";
31 rev = version;
32 hash = "sha256-WOGtZ412tX3YH42JCd5HIngunluwtMmQrOSUZp23LPU=";
33 };
34
35 patches = [
36 (substituteAll {
37 src = ./paths.patch;
38 git = "${lib.getBin git}/bin/git";
39 })
40 ];
41
42 propagatedBuildInputs = [
43 eradicate
44 mccabe
45 mypy
46 pycodestyle
47 pydocstyle
48 pyflakes
49 setuptools
50 vulture
51 ];
52
53 # escape infinite recursion pylint -> isort -> pylama
54 doCheck = false;
55
56 nativeCheckInputs = [
57 pylint
58 pytestCheckHook
59 ];
60
61 preCheck = ''
62 export HOME=$TEMP
63 '';
64
65 disabledTests = [
66 "test_quotes" # FIXME package pylama-quotes
67 "test_radon" # FIXME package radon
68 ];
69
70 pythonImportsCheck = [ "pylama.main" ];
71
72 passthru.tests = {
73 check = pylama.overridePythonAttrs (_: {
74 doCheck = true;
75 });
76 };
77
78 meta = with lib; {
79 description = "Code audit tool for python";
80 mainProgram = "pylama";
81 homepage = "https://github.com/klen/pylama";
82 changelog = "https://github.com/klen/pylama/blob/${version}/Changelog";
83 license = licenses.mit;
84 maintainers = with maintainers; [ dotlambda ];
85 };
86 };
87in
88pylama