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