2020-04-24 23:36:52 +00:00
|
|
|
{ lib
|
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-03-09 03:18:52 +00:00
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
# Check inputs
|
|
|
|
, pytestCheckHook
|
2021-03-09 03:18:52 +00:00
|
|
|
, networkx
|
2020-09-25 04:45:31 +00:00
|
|
|
, numpy
|
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-03-09 03:18:52 +00:00
|
|
|
version = "0.8.0";
|
|
|
|
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-03-09 03:18:52 +00:00
|
|
|
sha256 = "0plpri6a3d6f1000kmcah9066vq2i37d14bdf8sm96493fhpqhrd";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2021-03-09 03:18:52 +00:00
|
|
|
cargoDeps = rustPlatform.fetchCargoTarball {
|
|
|
|
inherit src;
|
|
|
|
name = "${pname}-${version}";
|
|
|
|
hash = "sha256-+k779gmge8wDdoZrWn9ND47kUqt7pqe75Zuj2Byfefo=";
|
|
|
|
};
|
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
|
|
|
|
2020-12-03 08:41:04 +00:00
|
|
|
# Needed b/c need to check AFTER python wheel is installed (using Rust Build, not buildPythonPackage)
|
2020-09-25 04:45:31 +00:00
|
|
|
doCheck = false;
|
|
|
|
doInstallCheck = true;
|
|
|
|
|
2021-03-09 03:18:52 +00:00
|
|
|
installCheckInputs = [ pytestCheckHook networkx numpy ];
|
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 ];
|
|
|
|
};
|
|
|
|
}
|