1{
2 stdenv,
3 lib,
4 buildPythonPackage,
5 cargo,
6 fetchPypi,
7 pytestCheckHook,
8 rustc,
9 rustPlatform,
10 libiconv,
11}:
12
13buildPythonPackage rec {
14 pname = "rpds-py";
15 version = "0.24.0";
16 pyproject = true;
17
18 src = fetchPypi {
19 pname = "rpds_py";
20 inherit version;
21 hash = "sha256-dyzBss2WPn4X5sxV/gNx+5xwTWPkTKzse5t/Ujt4kZ4=";
22 };
23
24 cargoDeps = rustPlatform.fetchCargoVendor {
25 inherit src;
26 name = "${pname}-${version}";
27 hash = "sha256-AHmnDTHuoB9wHH4CH20C+hFi9WaQBoUNMIvTIZlajVw=";
28 };
29
30 nativeBuildInputs = [
31 rustPlatform.cargoSetupHook
32 rustPlatform.maturinBuildHook
33 cargo
34 rustc
35 ];
36
37 buildInputs = lib.optionals stdenv.hostPlatform.isDarwin [ libiconv ];
38
39 nativeCheckInputs = [ pytestCheckHook ];
40
41 pythonImportsCheck = [ "rpds" ];
42
43 meta = with lib; {
44 changelog = "https://github.com/crate-py/rpds/releases/tag/v${version}";
45 description = "Python bindings to Rust's persistent data structures";
46 homepage = "https://github.com/crate-py/rpds";
47 license = licenses.mit;
48 maintainers = with maintainers; [ fab ];
49 };
50}