nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 stdenv,
4 astroid,
5 buildPythonPackage,
6 dill,
7 fetchFromGitHub,
8 gitpython,
9 isort,
10 mccabe,
11 platformdirs,
12 py,
13 pytest-timeout,
14 pytest-xdist,
15 pytest7CheckHook,
16 pythonAtLeast,
17 requests,
18 setuptools,
19 tomlkit,
20 typing-extensions,
21 writableTmpDirAsHomeHook,
22}:
23
24buildPythonPackage (finalAttrs: {
25 pname = "pylint";
26 version = "4.0.4";
27 pyproject = true;
28
29 src = fetchFromGitHub {
30 owner = "pylint-dev";
31 repo = "pylint";
32 tag = "v${finalAttrs.version}";
33 hash = "sha256-mKI/sRYl2ZwZ3JklmqBTs7vRG9EA4zDHaW61d/Xozb4=";
34 };
35
36 build-system = [ setuptools ];
37
38 dependencies = [
39 astroid
40 dill
41 isort
42 mccabe
43 platformdirs
44 tomlkit
45 ];
46
47 nativeCheckInputs = [
48 gitpython
49 # https://github.com/PyCQA/pylint/blob/main/requirements_test_min.txt
50 py
51 pytest-timeout
52 pytest-xdist
53 pytest7CheckHook
54 requests
55 typing-extensions
56 writableTmpDirAsHomeHook
57 ];
58
59 pytestFlags = [
60 # DeprecationWarning: pyreverse will drop support for resolving and
61 # displaying implemented interfaces in pylint 3.0. The
62 # implementation relies on the '__implements__' attribute proposed
63 # in PEP 245, which was rejected in 2006.
64 "-Wignore::DeprecationWarning"
65 "-v"
66 ];
67
68 disabledTestPaths = [
69 "tests/benchmark"
70 # tests miss multiple input files
71 # FileNotFoundError: [Errno 2] No such file or directory
72 "tests/pyreverse/test_writer.py"
73 ];
74
75 disabledTests = [
76 # AssertionError when self executing and checking output
77 # expected output looks like it should match though
78 "test_invocation_of_pylint_config"
79 "test_generate_rcfile"
80 "test_generate_toml_config"
81 "test_help_msg"
82 "test_output_of_callback_options"
83 # Failed: DID NOT WARN. No warnings of type (<class 'UserWarning'>,) were emitted. The list of emitted warnings is: [].
84 "test_save_and_load_not_a_linter_stats"
85 # Truncated string expectation mismatch
86 "test_truncated_compare"
87 # Probably related to pytest versions, see pylint-dev/pylint#9477 and pylint-dev/pylint#9483
88 "test_functional"
89 # AssertionError: assert [('specializa..., 'Ancestor')] == [('aggregatio..., 'Ancestor')]
90 "test_functional_relation_extraction"
91 ]
92 ++ lib.optionals (pythonAtLeast "3.14") [
93 # ModuleNotFoundError: No module named 'completely_unknown'
94 "test_do_not_import_files_from_local_directory"
95 ]
96 ++ lib.optionals stdenv.hostPlatform.isDarwin [
97 "test_parallel_execution"
98 "test_py3k_jobs_option"
99 ];
100
101 meta = {
102 description = "Bug and style checker for Python";
103 homepage = "https://pylint.readthedocs.io/en/stable/";
104 changelog = "https://github.com/pylint-dev/pylint/releases/tag/${finalAttrs.src.tag}";
105 longDescription = ''
106 Pylint is a Python static code analysis tool which looks for programming errors,
107 helps enforcing a coding standard, sniffs for code smells and offers simple
108 refactoring suggestions.
109 Pylint is shipped with following additional commands:
110 - pyreverse: an UML diagram generator
111 - symilar: an independent similarities checker
112 - epylint: Emacs and Flymake compatible Pylint
113 '';
114 license = lib.licenses.gpl2Plus;
115 maintainers = [ ];
116 mainProgram = "pylint";
117 };
118})