1{ 2 fetchFromGitHub, 3 buildPythonPackage, 4 cargo, 5 rustPlatform, 6 rustc, 7 setuptools-rust, 8 numpy, 9 fixtures, 10 networkx, 11 testtools, 12 libiconv, 13 stdenv, 14 lib, 15}: 16 17buildPythonPackage rec { 18 pname = "rustworkx"; 19 version = "0.14.2"; 20 format = "setuptools"; 21 22 src = fetchFromGitHub { 23 owner = "Qiskit"; 24 repo = pname; 25 rev = version; 26 hash = "sha256-gck5X6J4Yg5it/YCBsk/yZ5qXg/iwCEbyDIKfBTRxHM="; 27 }; 28 29 cargoDeps = rustPlatform.fetchCargoTarball { 30 inherit src; 31 hash = "sha256-FNCa5pshcnsYpjlz6yDITe2k0cHLTybj3rF34qrsRVU="; 32 }; 33 34 nativeBuildInputs = [ 35 setuptools-rust 36 rustPlatform.cargoSetupHook 37 cargo 38 rustc 39 ]; 40 41 buildInputs = [ numpy ] ++ lib.optionals stdenv.isDarwin [ libiconv ]; 42 43 checkInputs = [ 44 fixtures 45 networkx 46 testtools 47 ]; 48 49 pythonImportsCheck = [ "rustworkx" ]; 50 51 meta = with lib; { 52 description = "A high performance Python graph library implemented in Rust"; 53 homepage = "https://github.com/Qiskit/rustworkx"; 54 license = licenses.asl20; 55 maintainers = with maintainers; [ raitobezarius ]; 56 }; 57}