{ lib , stdenv , pythonOlder , rustPlatform , fetchFromGitHub , buildPythonPackage , libiconv , numpy , psutil , pytestCheckHook , python-dateutil , pytz , xxhash }: buildPythonPackage rec { pname = "orjson"; version = "3.6.3"; disabled = pythonOlder "3.7"; src = fetchFromGitHub { owner = "ijl"; repo = pname; rev = version; sha256 = "10clf13bp3fqd9b7n1isrfwz7sngcl1j6birqc1xyg9wzfw1kslj"; }; cargoDeps = rustPlatform.fetchCargoTarball { inherit src; name = "${pname}-${version}"; sha256 = "163rf8k7qb1whjf78i8v5dlyif1sgvd9xkj8li81j45abgzkq86w"; }; format = "pyproject"; nativeBuildInputs = with rustPlatform; [ cargoSetupHook maturinBuildHook ]; buildInputs = lib.optionals stdenv.isDarwin [ libiconv ]; checkInputs = [ numpy psutil pytestCheckHook python-dateutil pytz xxhash ]; pythonImportsCheck = [ pname ]; meta = with lib; { description = "Fast, correct Python JSON library supporting dataclasses, datetimes, and numpy"; homepage = "https://github.com/ijl/orjson"; license = with licenses; [ asl20 mit ]; platforms = platforms.unix; maintainers = with maintainers; [ misuzu ]; }; }