1{ lib
2, stdenv
3, buildPythonPackage
4, fetchPypi
5, pytestCheckHook
6, pythonOlder
7, setuptools-scm
8}:
9
10buildPythonPackage rec {
11 pname = "cbor2";
12 version = "5.4.3";
13 format = "setuptools";
14
15 disabled = pythonOlder "3.7";
16
17 src = fetchPypi {
18 inherit pname version;
19 hash = "sha256-Yrhjxe5s7UAyr+lI88FITzdVUJldO4SYFFI3/ijlRsI=";
20 };
21
22 nativeBuildInputs = [
23 setuptools-scm
24 ];
25
26 checkInputs = [
27 pytestCheckHook
28 ];
29
30 postPatch = ''
31 substituteInPlace pyproject.toml \
32 --replace " --cov" ""
33 '';
34
35 # https://github.com/agronholm/cbor2/issues/99
36 disabledTests = lib.optionals stdenv.is32bit [
37 "test_huge_truncated_bytes"
38 "test_huge_truncated_string"
39 ];
40
41 pythonImportsCheck = [
42 "cbor2"
43 ];
44
45 meta = with lib; {
46 description = "Python CBOR (de)serializer with extensive tag support";
47 homepage = "https://github.com/agronholm/cbor2";
48 license = licenses.mit;
49 maintainers = with maintainers; [ taneb ];
50 };
51}