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