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.3.11"; # 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 tag = "v${version}";
24 hash = "sha256-lv+BQDYP7N4UGMf7XhB6HVDORPU0kZQPYveQWOcAqfQ=";
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 disabledTests = [
37 # UserWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html.
38 "test_identify_old_namespace_package_protocol"
39 ];
40
41 disabledTestPaths = [
42 # requires mypy
43 "tests/test_raw_building.py"
44 ];
45
46 passthru.tests = {
47 inherit pylint;
48 };
49
50 meta = with lib; {
51 changelog = "https://github.com/PyCQA/astroid/blob/v${version}/ChangeLog";
52 description = "Abstract syntax tree for Python with inference support";
53 homepage = "https://github.com/PyCQA/astroid";
54 license = licenses.lgpl21Plus;
55 maintainers = with maintainers; [ GaetanLepage ];
56 };
57}