33afbf39f6
checkInputs used to be added to nativeBuildInputs. Now we have nativeCheckInputs to do that instead. Doing this treewide change allows to keep hashes identical to before the introduction of nativeCheckInputs.
65 lines
1.2 KiB
Nix
65 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.2";
|
|
disabled = pythonOlder "3.7";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "ijl";
|
|
repo = pname;
|
|
rev = version;
|
|
hash = "sha256-jiyYCjZ6c62zmm4Ge9KbEI8/PtPunu79HVODyoHFdSg=";
|
|
};
|
|
|
|
cargoDeps = rustPlatform.fetchCargoTarball {
|
|
inherit src;
|
|
name = "${pname}-${version}";
|
|
hash = "sha256-z1B0oSp37OGJ21Q57UUfmSRfUWLftiiBayN9y6yKNyg=";
|
|
};
|
|
|
|
format = "pyproject";
|
|
|
|
nativeBuildInputs = [
|
|
cffi
|
|
] ++ (with rustPlatform; [
|
|
cargoSetupHook
|
|
maturinBuildHook
|
|
]);
|
|
|
|
buildInputs = lib.optionals stdenv.isDarwin [ libiconv ];
|
|
|
|
nativeCheckInputs = [
|
|
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 ];
|
|
};
|
|
}
|