1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 hatchling,
6 igraph,
7 matplotlib,
8 networkx,
9 numpy,
10 pandas,
11 pylint,
12 pytestCheckHook,
13}:
14
15buildPythonPackage rec {
16 pname = "iplotx";
17 version = "0.6.1";
18 pyproject = true;
19
20 src = fetchFromGitHub {
21 owner = "fabilab";
22 repo = "iplotx";
23 tag = version;
24 hash = "sha256-RleGCDsH9VLX5hgU1l5pN6a1x9p52VA35CM5B9rJiy0=";
25 };
26
27 build-system = [ hatchling ];
28
29 dependencies = [
30 matplotlib
31 numpy
32 pandas
33 pylint
34 ];
35
36 pythonRelaxDeps = [ "pylint" ];
37
38 optional-dependencies = {
39 igraph = [ igraph ];
40 networkx = [ networkx ];
41 };
42
43 postPatch = ''
44 # silence matplotlib warning
45 export MPLCONFIGDIR=$(mktemp -d)
46 '';
47
48 # These four tests result in an ImageComparisonFailure
49 disabledTests = [
50 "test_labels"
51 "test_complex"
52 "test_display_shortest_path"
53 "test_labels_and_colors"
54 ];
55
56 nativeCheckInputs = [ pytestCheckHook ] ++ lib.flatten (lib.attrValues optional-dependencies);
57
58 pythonImportsCheck = [ "iplotx" ];
59
60 meta = {
61 description = "Plot networkx from igraph and networkx";
62 homepage = "https://iplotx.readthedocs.io/";
63 license = lib.licenses.mit;
64 maintainers = with lib.maintainers; [ jboy ];
65 };
66}