1{ stdenv, lib, buildPythonPackage, fetchPypi, pythonOlder, astroid,
2 isort, mccabe, pytestCheckHook, pytest-benchmark, pytestrunner, toml }:
3
4buildPythonPackage rec {
5 pname = "pylint";
6 version = "2.5.3";
7
8 disabled = pythonOlder "3.4";
9
10 src = fetchPypi {
11 inherit pname version;
12 sha256 = "7dd78437f2d8d019717dbf287772d0b2dbdfd13fc016aa7faa08d67bccc46adc";
13 };
14
15 nativeBuildInputs = [ pytestrunner ];
16
17 checkInputs = [ pytestCheckHook pytest-benchmark ];
18
19 propagatedBuildInputs = [ astroid isort mccabe toml ];
20
21 postPatch = lib.optionalString stdenv.isDarwin ''
22 # Remove broken darwin test
23 rm -vf pylint/test/test_functional.py
24 '';
25
26 disabledTests = [
27 # https://github.com/PyCQA/pylint/issues/3198
28 "test_by_module_statement_value"
29 # has issues with local directories
30 "test_version"
31 ] ++ lib.optionals stdenv.isDarwin [
32 "test_parallel_execution"
33 "test_py3k_jobs_option"
34 ];
35
36 # calls executable in one of the tests
37 preCheck = ''
38 export PATH=$PATH:$out/bin
39 '';
40
41 dontUseSetuptoolsCheck = true;
42
43 postInstall = ''
44 mkdir -p $out/share/emacs/site-lisp
45 cp "elisp/"*.el $out/share/emacs/site-lisp/
46 '';
47
48 meta = with lib; {
49 homepage = "https://github.com/PyCQA/pylint";
50 description = "A bug and style checker for Python";
51 platforms = platforms.all;
52 license = licenses.gpl1Plus;
53 maintainers = with maintainers; [ nand0p ];
54 };
55}