2021-09-22 15:38:15 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, pythonOlder
|
|
|
|
, rustPlatform
|
|
|
|
, fetchFromGitHub
|
|
|
|
, buildPythonPackage
|
2022-08-12 12:06:08 +00:00
|
|
|
, cffi
|
2021-09-22 15:38:15 +00:00
|
|
|
, libiconv
|
|
|
|
, numpy
|
|
|
|
, psutil
|
|
|
|
, pytestCheckHook
|
|
|
|
, python-dateutil
|
|
|
|
, pytz
|
|
|
|
, xxhash
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "orjson";
|
2023-02-02 18:25:31 +00:00
|
|
|
version = "3.8.4";
|
2021-09-22 15:38:15 +00:00
|
|
|
disabled = pythonOlder "3.7";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "ijl";
|
|
|
|
repo = pname;
|
|
|
|
rev = version;
|
2023-02-02 18:25:31 +00:00
|
|
|
hash = "sha256-XQBiE8hmLC/AIRt0eJri/ilPHUEYiOxd0onRBQsx+pM=";
|
2021-09-22 15:38:15 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
cargoDeps = rustPlatform.fetchCargoTarball {
|
|
|
|
inherit src;
|
|
|
|
name = "${pname}-${version}";
|
2023-02-02 18:25:31 +00:00
|
|
|
hash = "sha256-O2W9zO7qHWG+78T+uECICAmecaSIbTTJPktJIPZYElE=";
|
2021-09-22 15:38:15 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
format = "pyproject";
|
|
|
|
|
2022-08-12 12:06:08 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
cffi
|
|
|
|
] ++ (with rustPlatform; [
|
2021-09-22 15:38:15 +00:00
|
|
|
cargoSetupHook
|
|
|
|
maturinBuildHook
|
2022-08-12 12:06:08 +00:00
|
|
|
]);
|
2021-09-22 15:38:15 +00:00
|
|
|
|
|
|
|
buildInputs = lib.optionals stdenv.isDarwin [ libiconv ];
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2021-09-22 15:38:15 +00:00
|
|
|
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";
|
2023-02-02 18:25:31 +00:00
|
|
|
changelog = "https://github.com/ijl/orjson/blob/${version}/CHANGELOG.md";
|
2021-09-22 15:38:15 +00:00
|
|
|
license = with licenses; [ asl20 mit ];
|
|
|
|
platforms = platforms.unix;
|
|
|
|
maintainers = with maintainers; [ misuzu ];
|
|
|
|
};
|
|
|
|
}
|