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