depot/third_party/nixpkgs/pkgs/development/python-modules/igraph/default.nix
Default email 5c370c0b2a Project import generated by Copybara.
GitOrigin-RevId: 33d1e753c82ffc557b4a585c77de43d4c922ebb5
2024-05-15 17:35:15 +02:00

78 lines
1.6 KiB
Nix

{ lib
, buildPythonPackage
, pythonOlder
, fetchFromGitHub
, pkg-config
, setuptools
, igraph
, texttable
, cairocffi
, matplotlib
, plotly
, pytestCheckHook
}:
buildPythonPackage rec {
pname = "igraph";
version = "0.11.5";
disabled = pythonOlder "3.8";
pyproject = true;
src = fetchFromGitHub {
owner = "igraph";
repo = "python-igraph";
rev = "refs/tags/${version}";
hash = "sha256-nfXCAjTKxtslVk17h60+v/JQusQTmaTRCPvvFG4/OPk=";
};
postPatch = ''
rm -r vendor
'';
nativeBuildInputs = [
pkg-config
setuptools
];
buildInputs = [
igraph
];
propagatedBuildInputs = [
texttable
];
passthru.optional-dependencies = {
cairo = [ cairocffi ];
matplotlib = [ matplotlib ];
plotly = [ plotly ];
plotting = [ cairocffi ];
};
# NB: We want to use our igraph, not vendored igraph, but even with
# pkg-config on the PATH, their custom setup.py still needs to be explicitly
# told to do it. ~ C.
env.IGRAPH_USE_PKG_CONFIG = true;
nativeCheckInputs = [
pytestCheckHook
] ++ lib.flatten (lib.attrValues passthru.optional-dependencies);
disabledTests = [
"testAuthorityScore"
"test_labels"
];
pythonImportsCheck = [ "igraph" ];
meta = with lib; {
description = "High performance graph data structures and algorithms";
mainProgram = "igraph";
homepage = "https://igraph.org/python/";
changelog = "https://github.com/igraph/python-igraph/blob/${src.rev}/CHANGELOG.md";
license = licenses.gpl2Plus;
maintainers = with maintainers; [ MostAwesomeDude dotlambda ];
};
}