2021-03-19 17:17:44 +00:00
|
|
|
{ stdenv
|
|
|
|
, lib
|
|
|
|
, buildPythonPackage
|
2021-09-18 10:52:07 +00:00
|
|
|
, fetchFromGitHub
|
2022-12-17 10:02:37 +00:00
|
|
|
, fetchpatch
|
2021-03-19 17:17:44 +00:00
|
|
|
, pythonOlder
|
|
|
|
, installShellFiles
|
|
|
|
, astroid
|
2022-04-27 09:35:20 +00:00
|
|
|
, dill
|
2021-03-19 17:17:44 +00:00
|
|
|
, isort
|
|
|
|
, mccabe
|
2021-09-18 10:52:07 +00:00
|
|
|
, platformdirs
|
2022-12-17 10:02:37 +00:00
|
|
|
, requests
|
|
|
|
, setuptools
|
2022-04-27 09:35:20 +00:00
|
|
|
, tomli
|
2022-06-26 10:26:21 +00:00
|
|
|
, tomlkit
|
2022-04-27 09:35:20 +00:00
|
|
|
, typing-extensions
|
2022-12-17 10:02:37 +00:00
|
|
|
, gitpython
|
2023-01-20 10:41:00 +00:00
|
|
|
, py
|
2022-04-27 09:35:20 +00:00
|
|
|
, pytest-timeout
|
2021-03-19 17:17:44 +00:00
|
|
|
, pytest-xdist
|
|
|
|
, pytestCheckHook
|
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "pylint";
|
2023-01-20 10:41:00 +00:00
|
|
|
version = "2.15.9";
|
2022-12-17 10:02:37 +00:00
|
|
|
format = "pyproject";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-06-26 10:26:21 +00:00
|
|
|
disabled = pythonOlder "3.7.2";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-09-18 10:52:07 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "PyCQA";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2023-01-20 10:41:00 +00:00
|
|
|
hash = "sha256-T+om5rrG0Gjyr05L5X4j82/S11Q7JBUDNOm4gVEQ494=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2022-12-17 10:02:37 +00:00
|
|
|
patches = [
|
|
|
|
(fetchpatch {
|
|
|
|
name = "fix-dummy-plugin-tests.patch";
|
|
|
|
url = "https://github.com/PyCQA/pylint/commit/e75089bae209d1b9ca72903c0d65530b02f67fdf.patch";
|
|
|
|
hash = "sha256-4ErlCMLTI5xIu1dCvcJsvo03dwcgLLbFFQ5M7DFdL3o=";
|
|
|
|
})
|
|
|
|
(fetchpatch {
|
|
|
|
name = "fix-pythonpath-tests.patch";
|
|
|
|
url = "https://github.com/PyCQA/pylint/commit/6725f761f2ac7a853e315790b496a2eb4d926694.patch";
|
|
|
|
hash = "sha256-Xaeub7uUaC07BBuusA6+neGiXFWWfVNBkGXmYJe7ot4=";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2021-03-19 17:17:44 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
installShellFiles
|
2022-12-17 10:02:37 +00:00
|
|
|
setuptools
|
2021-03-19 17:17:44 +00:00
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-03-19 17:17:44 +00:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
astroid
|
2022-04-27 09:35:20 +00:00
|
|
|
dill
|
2021-03-19 17:17:44 +00:00
|
|
|
isort
|
|
|
|
mccabe
|
2021-09-18 10:52:07 +00:00
|
|
|
platformdirs
|
2022-06-26 10:26:21 +00:00
|
|
|
tomlkit
|
2022-04-27 09:35:20 +00:00
|
|
|
] ++ lib.optionals (pythonOlder "3.11") [
|
|
|
|
tomli
|
|
|
|
] ++ lib.optionals (pythonOlder "3.9") [
|
|
|
|
typing-extensions
|
2021-03-19 17:17:44 +00:00
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-03-19 17:17:44 +00:00
|
|
|
postInstall = ''
|
|
|
|
mkdir -p $out/share/emacs/site-lisp
|
|
|
|
cp -v "elisp/"*.el $out/share/emacs/site-lisp/
|
|
|
|
installManPage man/*.1
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
2021-03-19 17:17:44 +00:00
|
|
|
checkInputs = [
|
2022-12-17 10:02:37 +00:00
|
|
|
gitpython
|
2022-04-27 09:35:20 +00:00
|
|
|
# https://github.com/PyCQA/pylint/blob/main/requirements_test_min.txt
|
2023-01-20 10:41:00 +00:00
|
|
|
py
|
2022-04-27 09:35:20 +00:00
|
|
|
pytest-timeout
|
2021-03-19 17:17:44 +00:00
|
|
|
pytest-xdist
|
|
|
|
pytestCheckHook
|
2022-12-17 10:02:37 +00:00
|
|
|
requests
|
2022-04-27 09:35:20 +00:00
|
|
|
typing-extensions
|
2021-03-19 17:17:44 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
dontUseSetuptoolsCheck = true;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2020-06-15 15:56:04 +00:00
|
|
|
preCheck = ''
|
2021-12-26 17:43:05 +00:00
|
|
|
export HOME=$TEMPDIR
|
2020-06-15 15:56:04 +00:00
|
|
|
'';
|
|
|
|
|
2021-09-18 10:52:07 +00:00
|
|
|
disabledTestPaths = [
|
2022-06-16 17:23:12 +00:00
|
|
|
"tests/benchmark"
|
2021-09-18 10:52:07 +00:00
|
|
|
# tests miss multiple input files
|
|
|
|
# FileNotFoundError: [Errno 2] No such file or directory
|
|
|
|
"tests/pyreverse/test_writer.py"
|
|
|
|
];
|
|
|
|
|
2022-06-26 10:26:21 +00:00
|
|
|
disabledTests = [
|
|
|
|
# AssertionError when self executing and checking output
|
|
|
|
# expected output looks like it should match though
|
|
|
|
"test_invocation_of_pylint_config"
|
|
|
|
"test_generate_rcfile"
|
|
|
|
"test_generate_toml_config"
|
|
|
|
"test_help_msg"
|
|
|
|
"test_output_of_callback_options"
|
2022-08-12 12:06:08 +00:00
|
|
|
# Failed: DID NOT WARN. No warnings of type (<class 'UserWarning'>,) were emitted. The list of emitted warnings is: [].
|
|
|
|
"test_save_and_load_not_a_linter_stats"
|
2022-06-26 10:26:21 +00:00
|
|
|
] ++ lib.optionals stdenv.isDarwin [
|
2021-03-19 17:17:44 +00:00
|
|
|
"test_parallel_execution"
|
|
|
|
"test_py3k_jobs_option"
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
2020-10-07 09:15:18 +00:00
|
|
|
homepage = "https://pylint.pycqa.org/";
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "A bug and style checker for Python";
|
2022-05-18 14:49:53 +00:00
|
|
|
longDescription = ''
|
|
|
|
Pylint is a Python static code analysis tool which looks for programming errors,
|
|
|
|
helps enforcing a coding standard, sniffs for code smells and offers simple
|
|
|
|
refactoring suggestions.
|
|
|
|
Pylint is shipped with following additional commands:
|
|
|
|
- pyreverse: an UML diagram generator
|
|
|
|
- symilar: an independent similarities checker
|
|
|
|
- epylint: Emacs and Flymake compatible Pylint
|
|
|
|
'';
|
2020-04-24 23:36:52 +00:00
|
|
|
license = licenses.gpl1Plus;
|
2022-06-26 10:26:21 +00:00
|
|
|
maintainers = with maintainers; [ SuperSandro2000 ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|