{ lib , buildPythonPackage , rustPlatform , fetchFromGitHub # Check inputs , pytestCheckHook , numpy }: buildPythonPackage rec { pname = "retworkx"; version = "0.6.0"; src = fetchFromGitHub { owner = "Qiskit"; repo = "retworkx"; rev = version; sha256 = "11n30ldg3y3y6qxg3hbj837pnbwjkqw3nxq6frds647mmmprrd20"; }; cargoDeps = rustPlatform.fetchCargoTarball { inherit src; name = "${pname}-${version}"; hash = "sha256-heOBK8qi2nuc/Ib+I/vLzZ1fUUD/G/KTw9d7M4Hz5O0="; }; format = "pyproject"; 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 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 ]; }; }