1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 pytestCheckHook,
6 setuptools,
7 cython,
8 borgbackup,
9}:
10
11buildPythonPackage rec {
12 pname = "msgpack";
13 version = "1.1.1";
14 pyproject = true;
15
16 src = fetchFromGitHub {
17 owner = "msgpack";
18 repo = "msgpack-python";
19 tag = "v${version}";
20 hash = "sha256-j1MpdnfG6tCgAFlza64erMhJm/MkSK2QnixNv7MrQes=";
21 };
22
23 build-system = [ setuptools ];
24
25 nativeBuildInputs = [ cython ];
26
27 nativeCheckInputs = [ pytestCheckHook ];
28
29 pythonImportsCheck = [ "msgpack" ];
30
31 passthru.tests = {
32 # borgbackup is sensible to msgpack versions: https://github.com/borgbackup/borg/issues/3753
33 # please be mindful before bumping versions.
34 inherit borgbackup;
35 };
36
37 preBuild = ''
38 make cython
39 '';
40
41 meta = with lib; {
42 description = "MessagePack serializer implementation";
43 homepage = "https://github.com/msgpack/msgpack-python";
44 changelog = "https://github.com/msgpack/msgpack-python/blob/${src.tag}/ChangeLog.rst";
45 license = licenses.asl20;
46 maintainers = with maintainers; [ nickcao ];
47 };
48}