2021-01-15 22:18:51 +00:00
|
|
|
{ lib
|
2021-03-09 03:18:52 +00:00
|
|
|
, stdenv
|
2021-01-15 22:18:51 +00:00
|
|
|
, buildPythonPackage
|
|
|
|
, fetchPypi
|
|
|
|
, pytestCheckHook
|
2021-10-17 09:34:42 +00:00
|
|
|
, pythonOlder
|
2021-06-04 09:07:49 +00:00
|
|
|
, setuptools-scm
|
2021-01-15 22:18:51 +00:00
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "cbor2";
|
2022-06-16 17:23:12 +00:00
|
|
|
version = "5.4.3";
|
|
|
|
format = "setuptools";
|
2021-10-17 09:34:42 +00:00
|
|
|
|
2022-06-16 17:23:12 +00:00
|
|
|
disabled = pythonOlder "3.7";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2022-06-16 17:23:12 +00:00
|
|
|
hash = "sha256-Yrhjxe5s7UAyr+lI88FITzdVUJldO4SYFFI3/ijlRsI=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2021-10-17 09:34:42 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
setuptools-scm
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
checkInputs = [
|
2021-01-15 22:18:51 +00:00
|
|
|
pytestCheckHook
|
|
|
|
];
|
|
|
|
|
2021-10-17 09:34:42 +00:00
|
|
|
postPatch = ''
|
2022-06-16 17:23:12 +00:00
|
|
|
substituteInPlace pyproject.toml \
|
|
|
|
--replace " --cov" ""
|
2021-10-17 09:34:42 +00:00
|
|
|
'';
|
|
|
|
|
2021-03-09 03:18:52 +00:00
|
|
|
# https://github.com/agronholm/cbor2/issues/99
|
|
|
|
disabledTests = lib.optionals stdenv.is32bit [
|
|
|
|
"test_huge_truncated_bytes"
|
|
|
|
"test_huge_truncated_string"
|
|
|
|
];
|
|
|
|
|
2021-10-17 09:34:42 +00:00
|
|
|
pythonImportsCheck = [
|
|
|
|
"cbor2"
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
2021-01-15 22:18:51 +00:00
|
|
|
description = "Python CBOR (de)serializer with extensive tag support";
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "https://github.com/agronholm/cbor2";
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ taneb ];
|
|
|
|
};
|
|
|
|
}
|