1{
2 lib,
3 buildPythonPackage,
4 pythonOlder,
5 fetchFromGitHub,
6 pkg-config,
7 setuptools,
8 igraph,
9 texttable,
10 cairocffi,
11 matplotlib,
12 plotly,
13 pytestCheckHook,
14}:
15
16buildPythonPackage rec {
17 pname = "igraph";
18 version = "0.11.5";
19
20 disabled = pythonOlder "3.8";
21
22 pyproject = true;
23
24 src = fetchFromGitHub {
25 owner = "igraph";
26 repo = "python-igraph";
27 rev = "refs/tags/${version}";
28 hash = "sha256-nfXCAjTKxtslVk17h60+v/JQusQTmaTRCPvvFG4/OPk=";
29 };
30
31 postPatch = ''
32 rm -r vendor
33 '';
34
35 nativeBuildInputs = [
36 pkg-config
37 setuptools
38 ];
39
40 buildInputs = [ igraph ];
41
42 propagatedBuildInputs = [ texttable ];
43
44 passthru.optional-dependencies = {
45 cairo = [ cairocffi ];
46 matplotlib = [ matplotlib ];
47 plotly = [ plotly ];
48 plotting = [ cairocffi ];
49 };
50
51 # NB: We want to use our igraph, not vendored igraph, but even with
52 # pkg-config on the PATH, their custom setup.py still needs to be explicitly
53 # told to do it. ~ C.
54 env.IGRAPH_USE_PKG_CONFIG = true;
55
56 nativeCheckInputs = [
57 pytestCheckHook
58 ] ++ lib.flatten (lib.attrValues passthru.optional-dependencies);
59
60 disabledTests = [
61 "testAuthorityScore"
62 "test_labels"
63 ];
64
65 pythonImportsCheck = [ "igraph" ];
66
67 meta = with lib; {
68 description = "High performance graph data structures and algorithms";
69 mainProgram = "igraph";
70 homepage = "https://igraph.org/python/";
71 changelog = "https://github.com/igraph/python-igraph/blob/${src.rev}/CHANGELOG.md";
72 license = licenses.gpl2Plus;
73 maintainers = with maintainers; [
74 MostAwesomeDude
75 dotlambda
76 ];
77 };
78}