1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 pythonOlder,
6 setuptools,
7 typing-extensions,
8 pip,
9 pylint,
10 pytestCheckHook,
11}:
12
13buildPythonPackage rec {
14 pname = "astroid";
15 version = "3.2.2"; # Check whether the version is compatible with pylint
16 pyproject = true;
17
18 disabled = pythonOlder "3.8";
19
20 src = fetchFromGitHub {
21 owner = "PyCQA";
22 repo = "astroid";
23 rev = "refs/tags/v${version}";
24 hash = "sha256-Fc/AjMOz9D9SgkxXvMAhvJcZtj9BsPykg0DX4hEqdB8=";
25 };
26
27 nativeBuildInputs = [ setuptools ];
28
29 propagatedBuildInputs = lib.optionals (pythonOlder "3.11") [ typing-extensions ];
30
31 nativeCheckInputs = [
32 pip
33 pytestCheckHook
34 ];
35
36 passthru.tests = {
37 inherit pylint;
38 };
39
40 meta = with lib; {
41 changelog = "https://github.com/PyCQA/astroid/blob/${src.rev}/ChangeLog";
42 description = "Abstract syntax tree for Python with inference support";
43 homepage = "https://github.com/PyCQA/astroid";
44 license = licenses.lgpl21Plus;
45 maintainers = with maintainers; [ GaetanLepage ];
46 };
47}