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