{ lib, buildPythonPackage, rustPlatform, fetchFromGitHub, libiconv, dirty-equals, pytestCheckHook, nix-update-script, }: buildPythonPackage rec { pname = "jiter"; version = "0.8.2"; pyproject = true; src = fetchFromGitHub { owner = "pydantic"; repo = "jiter"; tag = "v${version}"; hash = "sha256-6FPwQ6t/zLB86k97S+6z5xWKBPJvjZ5/x3KrxOOT1gk="; }; 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 ]; }; }