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