depot/third_party/nixpkgs/pkgs/development/python-modules/pycrdt/default.nix
Default email 472aeafc57 Project import generated by Copybara.
GitOrigin-RevId: c31898adf5a8ed202ce5bea9f347b1c6871f32d1
2024-10-04 18:56:33 +02:00

71 lines
1.3 KiB
Nix

{
lib,
stdenv,
buildPythonPackage,
fetchFromGitHub,
# buildInputs
libiconv,
# nativeBuildInputs
rustPlatform,
# tests
anyio,
objsize,
pydantic,
pytestCheckHook,
trio,
y-py,
nix-update-script,
}:
buildPythonPackage rec {
pname = "pycrdt";
version = "0.9.16";
pyproject = true;
src = fetchFromGitHub {
owner = "jupyter-server";
repo = "pycrdt";
rev = "refs/tags/v${version}";
hash = "sha256-AO5KGBG4I+D5q/VSifzmg0ImAujR1ol9zGU4Y61fImc=";
};
postPatch = ''
cp ${./Cargo.lock} Cargo.lock
'';
cargoDeps = rustPlatform.importCargoLock { lockFile = ./Cargo.lock; };
nativeBuildInputs = [
rustPlatform.cargoSetupHook
rustPlatform.maturinBuildHook
];
buildInputs = lib.optionals stdenv.hostPlatform.isDarwin [ libiconv ];
dependencies = [ anyio ];
pythonImportsCheck = [ "pycrdt" ];
nativeCheckInputs = [
anyio
objsize
pydantic
pytestCheckHook
trio
y-py
];
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/releases/tag/${lib.removePrefix "refs/tags/" src.rev}";
license = lib.licenses.mit;
maintainers = lib.teams.jupyter.members;
};
}