5083ee08a2
GitOrigin-RevId: 10ecda252ce1b3b1d6403caeadbcc8f30d5ab796
64 lines
1.2 KiB
Nix
64 lines
1.2 KiB
Nix
{ lib
|
|
, stdenv
|
|
, pythonOlder
|
|
, rustPlatform
|
|
, fetchFromGitHub
|
|
, buildPythonPackage
|
|
, cffi
|
|
, libiconv
|
|
, numpy
|
|
, psutil
|
|
, pytestCheckHook
|
|
, python-dateutil
|
|
, pytz
|
|
, xxhash
|
|
}:
|
|
|
|
buildPythonPackage rec {
|
|
pname = "orjson";
|
|
version = "3.8.0";
|
|
disabled = pythonOlder "3.7";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "ijl";
|
|
repo = pname;
|
|
rev = version;
|
|
hash = "sha256-P1n0r5181Wt4tml2SKMI7pDNh2YakCp1I+cvQM6RRWg=";
|
|
};
|
|
|
|
cargoDeps = rustPlatform.fetchCargoTarball {
|
|
inherit src;
|
|
name = "${pname}-${version}";
|
|
hash = "sha256-8k0DetamwLqkdcg8V/D2J5ja6IJSLi50CE+ZjFa7Hdc=";
|
|
};
|
|
|
|
format = "pyproject";
|
|
|
|
nativeBuildInputs = [
|
|
cffi
|
|
] ++ (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 ];
|
|
};
|
|
}
|