{ lib, buildPythonPackage, fetchFromGitHub, # nativeBuildInputs rustPlatform, # tests anyio, objsize, pydantic, pytestCheckHook, trio, y-py, nix-update-script, }: buildPythonPackage rec { pname = "pycrdt"; version = "0.12.42"; pyproject = true; src = fetchFromGitHub { owner = "y-crdt"; repo = "pycrdt"; tag = version; hash = "sha256-TEuP6mkd4phic2vJv0BYD50GvlrNj4Z4/jMknLfnYI8="; }; postPatch = '' cp ${./Cargo.lock} Cargo.lock ''; cargoDeps = rustPlatform.importCargoLock { lockFile = ./Cargo.lock; }; nativeBuildInputs = [ rustPlatform.cargoSetupHook rustPlatform.maturinBuildHook ]; dependencies = [ anyio ]; pythonImportsCheck = [ "pycrdt" ]; nativeCheckInputs = [ anyio objsize pydantic pytestCheckHook trio y-py ]; pytestFlags = [ "-Wignore::pytest.PytestUnknownMarkWarning" # requires unpackaged pytest-mypy-testing ]; passthru.updateScript = nix-update-script { extraArgs = [ "--generate-lockfile" ]; }; meta = { description = "CRDTs based on Yrs"; homepage = "https://github.com/jupyter-server/pycrdt"; changelog = "https://github.com/jupyter-server/pycrdt/blob/${version}/CHANGELOG.md"; license = lib.licenses.mit; teams = [ lib.teams.jupyter ]; }; }