diff --git a/pkgs/development/python-modules/iplotx/default.nix b/pkgs/development/python-modules/iplotx/default.nix new file mode 100644 index 000000000000..a4d0ae442fd2 --- /dev/null +++ b/pkgs/development/python-modules/iplotx/default.nix @@ -0,0 +1,66 @@ +{ + lib, + buildPythonPackage, + fetchFromGitHub, + hatchling, + igraph, + matplotlib, + networkx, + numpy, + pandas, + pylint, + pytestCheckHook, +}: + +buildPythonPackage rec { + pname = "iplotx"; + version = "0.3.1"; + pyproject = true; + + src = fetchFromGitHub { + owner = "fabilab"; + repo = "iplotx"; + tag = version; + hash = "sha256-3Nn/sz1yUaxhGFr0hMGoLEBF5pNs+tz/KpsGtKkYujo="; + }; + + build-system = [ hatchling ]; + + dependencies = [ + matplotlib + numpy + pandas + pylint + ]; + + pythonRelaxDeps = [ "pylint" ]; + + optional-dependencies = { + igraph = [ igraph ]; + networkx = [ networkx ]; + }; + + postPatch = '' + # silence matplotlib warning + export MPLCONFIGDIR=$(mktemp -d) + ''; + + # These four tests result in an ImageComparisonFailure + disabledTests = [ + "test_labels" + "test_complex" + "test_display_shortest_path" + "test_labels_and_colors" + ]; + + nativeCheckInputs = [ pytestCheckHook ] ++ lib.flatten (lib.attrValues optional-dependencies); + + pythonImportsCheck = [ "iplotx" ]; + + meta = { + description = "Plot networkx from igraph and networkx"; + homepage = "https://iplotx.readthedocs.io/"; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ jboy ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 7aaf06856b21..c02e9c7755d3 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -6732,6 +6732,8 @@ self: super: with self; { ipfshttpclient = callPackage ../development/python-modules/ipfshttpclient { }; + iplotx = callPackage ../development/python-modules/iplotx { }; + iptools = callPackage ../development/python-modules/iptools { }; ipwhl = callPackage ../development/python-modules/ipwhl { };