1{
2 lib,
3 buildPythonPackage,
4 ciso8601,
5 fetchFromGitHub,
6 msgpack,
7 orjson,
8 pendulum,
9 pytest-mock,
10 pytestCheckHook,
11 pythonOlder,
12 pyyaml,
13 setuptools,
14 tomli,
15 tomli-w,
16 typing-extensions,
17}:
18
19buildPythonPackage rec {
20 pname = "mashumaro";
21 version = "3.16";
22 pyproject = true;
23
24 disabled = pythonOlder "3.8";
25
26 src = fetchFromGitHub {
27 owner = "Fatal1ty";
28 repo = "mashumaro";
29 tag = "v${version}";
30 hash = "sha256-SAdhBNQx5zWsXFwWxEAozprb2c7eJRdxZQwZMgBj/iA=";
31 };
32
33 build-system = [ setuptools ];
34
35 dependencies = [ typing-extensions ];
36
37 optional-dependencies = {
38 orjson = [ orjson ];
39 msgpack = [ msgpack ];
40 yaml = [ pyyaml ];
41 toml = [ tomli-w ] ++ lib.optionals (pythonOlder "3.11") [ tomli ];
42 };
43
44 nativeCheckInputs = [
45 ciso8601
46 pendulum
47 pytest-mock
48 pytestCheckHook
49 ]
50 ++ lib.flatten (lib.attrValues optional-dependencies);
51
52 pythonImportsCheck = [ "mashumaro" ];
53
54 meta = with lib; {
55 description = "Serialization library on top of dataclasses";
56 homepage = "https://github.com/Fatal1ty/mashumaro";
57 changelog = "https://github.com/Fatal1ty/mashumaro/releases/tag/${src.tag}";
58 license = licenses.asl20;
59 maintainers = with maintainers; [ tjni ];
60 };
61}