1{
2 lib,
3 buildPythonPackage,
4 fetchPypi,
5 pythonOlder,
6
7 # build-system
8 setuptools,
9 setuptools-scm,
10
11 # tests
12 hypothesis,
13 pytestCheckHook,
14}:
15
16buildPythonPackage rec {
17 pname = "cbor2";
18 version = "5.6.4";
19 pyproject = true;
20
21 disabled = pythonOlder "3.8";
22
23 src = fetchPypi {
24 inherit pname version;
25 hash = "sha256-HFM8UN3oa+8caVBgIFSg/6PDduiw4gx7j1sQh5P2mD4=";
26 };
27
28 postPatch = ''
29 substituteInPlace pyproject.toml \
30 --replace " --cov" ""
31 '';
32
33 nativeBuildInputs = [
34 setuptools
35 setuptools-scm
36 ];
37
38 pythonImportsCheck = [ "cbor2" ];
39
40 nativeCheckInputs = [
41 hypothesis
42 pytestCheckHook
43 ];
44
45 meta = with lib; {
46 changelog = "https://github.com/agronholm/cbor2/releases/tag/${version}";
47 description = "Python CBOR (de)serializer with extensive tag support";
48 mainProgram = "cbor2";
49 homepage = "https://github.com/agronholm/cbor2";
50 license = licenses.mit;
51 maintainers = [ ];
52 };
53}