1{
2 stdenv,
3 lib,
4 buildPythonPackage,
5 cargo,
6 fetchPypi,
7 pytestCheckHook,
8 pythonOlder,
9 rustc,
10 rustPlatform,
11 libiconv,
12}:
13
14buildPythonPackage rec {
15 pname = "rpds-py";
16 version = "0.17.1";
17 format = "pyproject";
18
19 disabled = pythonOlder "3.8";
20
21 src = fetchPypi {
22 pname = "rpds_py";
23 inherit version;
24 hash = "sha256-AhCyZo8kwHgwcmC/iL2snW8Qk2Nd9RI3ib/uTY1/yOc=";
25 };
26
27 cargoDeps = rustPlatform.fetchCargoTarball {
28 inherit src;
29 name = "${pname}-${version}";
30 hash = "sha256-sFutrKLa2ISxtUN7hmw2P02nl4SM6Hn4yj1kkXrNWmI=";
31 };
32
33 nativeBuildInputs = [
34 rustPlatform.cargoSetupHook
35 rustPlatform.maturinBuildHook
36 cargo
37 rustc
38 ];
39
40 buildInputs = lib.optionals stdenv.hostPlatform.isDarwin [ libiconv ];
41
42 nativeCheckInputs = [ pytestCheckHook ];
43
44 pythonImportsCheck = [ "rpds" ];
45
46 meta = with lib; {
47 description = "Python bindings to Rust's persistent data structures (rpds";
48 homepage = "https://pypi.org/project/rpds-py/";
49 license = licenses.mit;
50 maintainers = with maintainers; [ fab ];
51 };
52}