depot/third_party/nixpkgs/pkgs/development/python-modules/retworkx/default.nix
Default email 75ca762b89 Project import generated by Copybara.
GitOrigin-RevId: 29b0d4d0b600f8f5dd0b86e3362a33d4181938f9
2021-03-09 11:18:52 +08:00

55 lines
1.4 KiB
Nix

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