depot/third_party/nixpkgs/pkgs/development/python-modules/orjson/default.nix
Default email 01ed8ef136 Project import generated by Copybara.
GitOrigin-RevId: 20fc948445a6c22d4e8d5178e9a6bc6e1f5417c8
2022-11-21 19:40:18 +02:00

70 lines
1.4 KiB
Nix

{ lib
, stdenv
, pythonOlder
, rustPlatform
, fetchFromGitHub
, buildPythonPackage
, cffi
, libiconv
, numpy
, psutil
, pytestCheckHook
, python-dateutil
, pytz
, xxhash
}:
buildPythonPackage rec {
pname = "orjson";
version = "3.8.1";
disabled = pythonOlder "3.7";
src = fetchFromGitHub {
owner = "ijl";
repo = pname;
rev = version;
hash = "sha256-3U27JuKMsMla3BKbbpO0uXesGHYaVQs8MwtQvumkksY=";
};
cargoDeps = rustPlatform.fetchCargoTarball {
inherit src;
name = "${pname}-${version}";
hash = "sha256-QXguyDxQHW9Fd3Nhmi5JzSxZQuk3HGPhhh/RGuOTZNY";
};
format = "pyproject";
nativeBuildInputs = [
cffi
] ++ (with rustPlatform; [
cargoSetupHook
maturinBuildHook
]);
buildInputs = lib.optionals stdenv.isDarwin [ libiconv ];
checkInputs = [
numpy
psutil
pytestCheckHook
python-dateutil
pytz
xxhash
];
disabledTests = lib.optionals (stdenv.is32bit) [
# integer overflow on 32bit
"test_numpy_array_d1_intp"
"test_numpy_array_d1_uintp"
];
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 ];
};
}