blob: 5ee0d5846d8960b711460839ff9c67ed0170a8d2 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
|
{
lib,
buildPythonPackage,
rustPlatform,
fetchFromGitHub,
libiconv,
dirty-equals,
pytestCheckHook,
nix-update-script,
}:
buildPythonPackage rec {
pname = "jiter";
version = "0.12.0";
pyproject = true;
src = fetchFromGitHub {
owner = "pydantic";
repo = "jiter";
tag = "v${version}";
hash = "sha256-d87RUXKEmZXxVQZnAvjwRKSP6F3Z+kXxg/LdY2l9B+k=";
};
postPatch = ''
cp ${./Cargo.lock} Cargo.lock
'';
cargoDeps = rustPlatform.importCargoLock { lockFile = ./Cargo.lock; };
buildAndTestSubdir = "crates/jiter-python";
nativeBuildInputs = [ rustPlatform.cargoSetupHook ];
build-system = [ rustPlatform.maturinBuildHook ];
buildInputs = [ libiconv ];
pythonImportsCheck = [ "jiter" ];
nativeCheckInputs = [
dirty-equals
pytestCheckHook
];
passthru.updateScript = nix-update-script { extraArgs = [ "--generate-lockfile" ]; };
meta = {
description = "Fast iterable JSON parser";
homepage = "https://github.com/pydantic/jiter/";
changelog = "https://github.com/pydantic/jiter/releases/tag/v${version}";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ natsukium ];
};
}
|