nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{ lib
2, buildPythonPackage
3, fetchFromGitHub
4, substituteAll
5, git
6, eradicate
7, mccabe
8, mypy
9, pycodestyle
10, pydocstyle
11, pyflakes
12, vulture
13, isort
14, pylint
15, pytestCheckHook
16}:
17
18buildPythonPackage rec {
19 pname = "pylama";
20 version = "8.3.8";
21
22 format = "setuptools";
23
24 src = fetchFromGitHub {
25 name = "${pname}-${version}-source";
26 owner = "klen";
27 repo = "pylama";
28 rev = version;
29 hash = "sha256-g6Lq5NaieUI/alxqoVFfL5VaCHwB/jLcp02/N1W69yE=";
30 };
31
32 patches = [
33 (substituteAll {
34 src = ./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 vulture
47 ];
48
49 checkInputs = [
50 # avoid infinite recursion pylint -> isort -> pylama
51 (pylint.override {
52 isort = isort.overridePythonAttrs (old: {
53 doCheck = false;
54 });
55 })
56 pytestCheckHook
57 ];
58
59 preCheck = ''
60 export HOME=$TEMP
61 '';
62
63 disabledTests = [
64 "test_quotes" # FIXME package pylama-quotes
65 "test_radon" # FIXME package radon
66 ];
67
68 pythonImportsCheck = [
69 "pylama.main"
70 ];
71
72 meta = with lib; {
73 description = "Code audit tool for python";
74 homepage = "https://github.com/klen/pylama";
75 changelog = "https://github.com/klen/pylama/blob/${version}/Changelog";
76 license = licenses.mit;
77 maintainers = with maintainers; [ dotlambda ];
78 };
79}