aboutsummaryrefslogtreecommitdiff
path: root/infra/libkookie/nixpkgs/pkgs/development/python-modules/pylint/default.nix
blob: 19ffb6419d9ab6555e085b13ae718f32e334840a (plain)
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
{ stdenv, lib, buildPythonPackage, fetchPypi, pythonOlder, astroid, installShellFiles,
  isort, mccabe, pytestCheckHook, pytest-benchmark, pytestrunner, toml }:

buildPythonPackage rec {
  pname = "pylint";
  version = "2.6.2";

  disabled = pythonOlder "3.5";

  src = fetchPypi {
    inherit pname version;
    sha256 = "sha256-cYt0eG6n7QeqDFi/VyFU1Geflg0m6WQcwd4gSjC4f8k=";
  };

  nativeBuildInputs = [ pytestrunner installShellFiles ];

  checkInputs = [ pytestCheckHook pytest-benchmark ];

  propagatedBuildInputs = [ astroid isort mccabe toml ];

  postPatch = lib.optionalString stdenv.isDarwin ''
    # Remove broken darwin test
    rm -vf pylint/test/test_functional.py
  '';

  disabledTests = [
    # https://github.com/PyCQA/pylint/issues/3198
    "test_by_module_statement_value"
    # has issues with local directories
    "test_version"
   ] ++ lib.optionals stdenv.isDarwin [
      "test_parallel_execution"
      "test_py3k_jobs_option"
   ];

  # calls executable in one of the tests
  preCheck = ''
    export PATH=$PATH:$out/bin
  '';

  dontUseSetuptoolsCheck = true;

  postInstall = ''
    mkdir -p $out/share/emacs/site-lisp
    cp "elisp/"*.el $out/share/emacs/site-lisp/
    installManPage man/*.1
  '';

  meta = with lib; {
    homepage = "https://pylint.pycqa.org/";
    description = "A bug and style checker for Python";
    license = licenses.gpl1Plus;
    maintainers = with maintainers; [ nand0p ];
  };
}