2020-04-24 23:36:52 +00:00
|
|
|
{ lib
|
2021-06-04 09:07:49 +00:00
|
|
|
, stdenv
|
2021-03-09 03:18:52 +00:00
|
|
|
, buildPythonPackage
|
|
|
|
, pythonOlder
|
2020-09-25 04:45:31 +00:00
|
|
|
, rustPlatform
|
2020-04-24 23:36:52 +00:00
|
|
|
, fetchFromGitHub
|
2021-06-04 09:07:49 +00:00
|
|
|
, libiconv
|
2020-04-24 23:36:52 +00:00
|
|
|
# Check inputs
|
|
|
|
, pytestCheckHook
|
2021-06-04 09:07:49 +00:00
|
|
|
, fixtures
|
|
|
|
, graphviz
|
|
|
|
, matplotlib
|
2021-03-09 03:18:52 +00:00
|
|
|
, networkx
|
2020-09-25 04:45:31 +00:00
|
|
|
, numpy
|
2021-06-04 09:07:49 +00:00
|
|
|
, pydot
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
2020-07-18 16:06:22 +00:00
|
|
|
|
2021-03-09 03:18:52 +00:00
|
|
|
buildPythonPackage rec {
|
2020-09-25 04:45:31 +00:00
|
|
|
pname = "retworkx";
|
2021-06-04 09:07:49 +00:00
|
|
|
version = "0.9.0";
|
2021-03-09 03:18:52 +00:00
|
|
|
format = "pyproject";
|
|
|
|
disabled = pythonOlder "3.6";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2020-09-25 04:45:31 +00:00
|
|
|
src = fetchFromGitHub {
|
2020-04-24 23:36:52 +00:00
|
|
|
owner = "Qiskit";
|
|
|
|
repo = "retworkx";
|
2020-09-25 04:45:31 +00:00
|
|
|
rev = version;
|
2021-06-04 09:07:49 +00:00
|
|
|
hash = "sha256-1W7DexS+ECAPsxyZAF36xcEguFkjUMX9lDBylNVPqyk=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2021-03-09 03:18:52 +00:00
|
|
|
cargoDeps = rustPlatform.fetchCargoTarball {
|
|
|
|
inherit src;
|
|
|
|
name = "${pname}-${version}";
|
2021-06-04 09:07:49 +00:00
|
|
|
hash = "sha256-y5l7jqrlk3ONHefZPS31IvcaO9ttXWLM7fIUmNVwbco=";
|
2021-03-09 03:18:52 +00:00
|
|
|
};
|
2020-09-25 04:45:31 +00:00
|
|
|
|
2021-03-09 03:18:52 +00:00
|
|
|
nativeBuildInputs = with rustPlatform; [ cargoSetupHook maturinBuildHook ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-06-04 09:07:49 +00:00
|
|
|
buildInputs = lib.optionals stdenv.isDarwin [ libiconv ];
|
2020-09-25 04:45:31 +00:00
|
|
|
|
2021-06-04 09:07:49 +00:00
|
|
|
pythonImportsCheck = [ "retworkx" ];
|
|
|
|
checkInputs = [
|
|
|
|
pytestCheckHook
|
|
|
|
fixtures
|
|
|
|
graphviz
|
|
|
|
matplotlib
|
|
|
|
networkx
|
|
|
|
numpy
|
|
|
|
pydot
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
preCheck = ''
|
2020-09-25 04:45:31 +00:00
|
|
|
export TESTDIR=$(mktemp -d)
|
2020-12-03 08:41:04 +00:00
|
|
|
cp -r tests/ $TESTDIR
|
2020-09-25 04:45:31 +00:00
|
|
|
pushd $TESTDIR
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
postCheck = "popd";
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "A python graph library implemented in Rust.";
|
|
|
|
homepage = "https://retworkx.readthedocs.io/en/latest/index.html";
|
|
|
|
downloadPage = "https://github.com/Qiskit/retworkx/releases";
|
2020-09-25 04:45:31 +00:00
|
|
|
changelog = "https://github.com/Qiskit/retworkx/releases/tag/${version}";
|
2020-04-24 23:36:52 +00:00
|
|
|
license = licenses.asl20;
|
|
|
|
maintainers = with maintainers; [ drewrisinger ];
|
|
|
|
};
|
|
|
|
}
|