nixpkgs/pkgs/development/python-modules/orjson/default.nix
2021-10-08 11:19:07 -07:00

61 lines
1.2 KiB
Nix

{ lib
, stdenv
, pythonOlder
, rustPlatform
, fetchFromGitHub
, buildPythonPackage
, libiconv
, numpy
, psutil
, pytestCheckHook
, python-dateutil
, pytz
, xxhash
}:
buildPythonPackage rec {
pname = "orjson";
version = "3.6.4";
disabled = pythonOlder "3.7";
src = fetchFromGitHub {
owner = "ijl";
repo = pname;
rev = version;
sha256 = "0xpna70s5v7d4lwsb6ijc0f2rm6p7jqmac9yayx9qb1dasbki6zd";
};
cargoDeps = rustPlatform.fetchCargoTarball {
inherit src;
name = "${pname}-${version}";
sha256 = "0m4f8lc0zwxh4lmxkpxvdd2lc2g3lkq0ymllqbyr31sbxvwnxk56";
};
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 ];
};
}