1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-12-25 03:17:13 +00:00
nixpkgs/pkgs/development/python-modules/jiter/default.nix

55 lines
1.2 KiB
Nix

{
lib,
buildPythonPackage,
rustPlatform,
fetchFromGitHub,
libiconv,
dirty-equals,
pytestCheckHook,
nix-update-script,
}:
buildPythonPackage rec {
pname = "jiter";
version = "0.6.1";
pyproject = true;
src = fetchFromGitHub {
owner = "pydantic";
repo = "jiter";
rev = "refs/tags/v${version}";
hash = "sha256-XYOdy7jduPak8XBL2hdAQfBxrmPq/nyzNlA4RygCtK0=";
};
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 ];
};
}