1{ lib
2, stdenv
3, buildPythonPackage
4, fetchPypi
5, rustPlatform
6, cargo
7, rustc
8, libiconv
9, pytestCheckHook
10}:
11
12buildPythonPackage rec {
13 pname = "y-py";
14 version = "0.6.2";
15 format = "pyproject";
16
17 src = fetchPypi {
18 pname = "y_py";
19 inherit version;
20 hash = "sha256-R1eoKlBAags6MzqgEiAZozG9bxbkn+1n3KQj+Siz/U0=";
21 };
22
23 cargoDeps = rustPlatform.fetchCargoTarball {
24 inherit src;
25 name = "${pname}-${version}";
26 hash = "sha256-RXwrDSPU0wiprsUJwoDzti14H/+bSwy4hK4tYhNVfYw=";
27 };
28
29 nativeBuildInputs = [
30 rustPlatform.cargoSetupHook
31 rustPlatform.maturinBuildHook
32 cargo
33 rustc
34 ];
35
36 buildInputs = lib.optional stdenv.isDarwin libiconv;
37
38 pythonImportsCheck = [ "y_py" ];
39
40 nativeCheckInputs = [
41 pytestCheckHook
42 ];
43
44 meta = {
45 description = "Python bindings for Y-CRDT";
46 homepage = "https://github.com/y-crdt/ypy";
47 license = lib.licenses.mit;
48 maintainers = with lib.maintainers; [ dotlambda ];
49 };
50}