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.6";
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 postFetch = ''
29 # export-subst prevents reproducability
30 rm $out/.git_archival.json
31 '';
32 hash = "sha256-DXYNFSvmKiulMnWL8w5l9lWGtS9Sff/Hn4x538nrvzo=";
33 };
34
35 postPatch = ''
36 rm -r vendor
37 '';
38
39 nativeBuildInputs = [ pkg-config ];
40
41 build-system = [ setuptools ];
42
43 buildInputs = [ igraph ];
44
45 dependencies = [ texttable ];
46
47 passthru.optional-dependencies = {
48 cairo = [ cairocffi ];
49 matplotlib = [ matplotlib ];
50 plotly = [ plotly ];
51 plotting = [ cairocffi ];
52 };
53
54 # NB: We want to use our igraph, not vendored igraph, but even with
55 # pkg-config on the PATH, their custom setup.py still needs to be explicitly
56 # told to do it. ~ C.
57 env.IGRAPH_USE_PKG_CONFIG = true;
58
59 nativeCheckInputs = [
60 pytestCheckHook
61 ] ++ lib.flatten (lib.attrValues passthru.optional-dependencies);
62
63 disabledTests = [
64 "testAuthorityScore"
65 "test_labels"
66 ];
67
68 pythonImportsCheck = [ "igraph" ];
69
70 meta = with lib; {
71 description = "High performance graph data structures and algorithms";
72 mainProgram = "igraph";
73 homepage = "https://igraph.org/python/";
74 changelog = "https://github.com/igraph/python-igraph/blob/${src.rev}/CHANGELOG.md";
75 license = licenses.gpl2Plus;
76 maintainers = with maintainers; [
77 MostAwesomeDude
78 dotlambda
79 ];
80 };
81}