2020-04-10 22:36:03 +01:00
|
|
|
{ lib
|
2021-02-11 18:18:02 +00:00
|
|
|
, buildPythonPackage
|
2021-03-05 19:26:31 +00:00
|
|
|
, pythonOlder
|
2020-08-14 23:22:50 +01:00
|
|
|
, rustPlatform
|
2020-04-10 22:36:03 +01:00
|
|
|
, fetchFromGitHub
|
2021-02-11 18:18:02 +00:00
|
|
|
|
2020-04-10 22:36:03 +01:00
|
|
|
# Check inputs
|
|
|
|
, pytestCheckHook
|
2021-03-05 19:26:31 +00:00
|
|
|
, networkx
|
2020-08-14 23:22:50 +01:00
|
|
|
, numpy
|
2020-04-10 22:36:03 +01:00
|
|
|
}:
|
2020-06-22 22:02:13 +01:00
|
|
|
|
2021-02-11 18:18:02 +00:00
|
|
|
buildPythonPackage rec {
|
2020-08-14 23:22:50 +01:00
|
|
|
pname = "retworkx";
|
2021-03-05 19:26:31 +00:00
|
|
|
version = "0.8.0";
|
|
|
|
format = "pyproject";
|
|
|
|
disabled = pythonOlder "3.6";
|
2020-04-10 22:36:03 +01:00
|
|
|
|
2020-08-14 23:22:50 +01:00
|
|
|
src = fetchFromGitHub {
|
2020-04-10 22:36:03 +01:00
|
|
|
owner = "Qiskit";
|
|
|
|
repo = "retworkx";
|
2020-08-14 23:22:50 +01:00
|
|
|
rev = version;
|
2021-03-05 19:26:31 +00:00
|
|
|
sha256 = "0plpri6a3d6f1000kmcah9066vq2i37d14bdf8sm96493fhpqhrd";
|
2020-04-10 22:36:03 +01:00
|
|
|
};
|
|
|
|
|
2021-02-11 18:18:02 +00:00
|
|
|
cargoDeps = rustPlatform.fetchCargoTarball {
|
|
|
|
inherit src;
|
|
|
|
name = "${pname}-${version}";
|
2021-03-05 19:26:31 +00:00
|
|
|
hash = "sha256-+k779gmge8wDdoZrWn9ND47kUqt7pqe75Zuj2Byfefo=";
|
2021-02-11 18:18:02 +00:00
|
|
|
};
|
2020-04-10 22:36:03 +01:00
|
|
|
|
2021-02-11 18:18:02 +00:00
|
|
|
nativeBuildInputs = with rustPlatform; [ cargoSetupHook maturinBuildHook ];
|
2020-04-10 22:36:03 +01:00
|
|
|
|
2020-11-04 17:57:15 +00:00
|
|
|
# Needed b/c need to check AFTER python wheel is installed (using Rust Build, not buildPythonPackage)
|
2020-08-14 23:22:50 +01:00
|
|
|
doCheck = false;
|
|
|
|
doInstallCheck = true;
|
|
|
|
|
2021-03-05 19:26:31 +00:00
|
|
|
installCheckInputs = [ pytestCheckHook networkx numpy ];
|
2020-11-04 17:57:15 +00:00
|
|
|
|
2020-04-10 22:36:03 +01:00
|
|
|
preCheck = ''
|
2020-08-14 23:22:50 +01:00
|
|
|
export TESTDIR=$(mktemp -d)
|
2020-11-04 17:57:15 +00:00
|
|
|
cp -r tests/ $TESTDIR
|
2020-08-14 23:22:50 +01:00
|
|
|
pushd $TESTDIR
|
2020-04-10 22:36:03 +01: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-08-14 23:22:50 +01:00
|
|
|
changelog = "https://github.com/Qiskit/retworkx/releases/tag/${version}";
|
2020-04-10 22:36:03 +01:00
|
|
|
license = licenses.asl20;
|
|
|
|
maintainers = with maintainers; [ drewrisinger ];
|
|
|
|
};
|
|
|
|
}
|