1{
2 lib,
3 fetchFromGitHub,
4 buildPythonPackage,
5 pythonOlder,
6 pythonAtLeast,
7 pytimeparse,
8 pyyaml,
9 pytestCheckHook,
10 pytest-mock,
11 typing-extensions,
12}:
13
14buildPythonPackage rec {
15 pname = "dataclass-wizard";
16 version = "0.22.2";
17 format = "setuptools";
18
19 src = fetchFromGitHub {
20 owner = "rnag";
21 repo = "dataclass-wizard";
22 rev = "v${version}";
23 hash = "sha256-Ufi4lZc+UkM6NZr4bS2OibpOmMjyiBEoVKxmrqauW50=";
24 };
25
26 propagatedBuildInputs = [ ] ++ lib.optionals (pythonOlder "3.9") [ typing-extensions ];
27
28 passthru.optional-dependencies = {
29 timedelta = [ pytimeparse ];
30 yaml = [ pyyaml ];
31 };
32
33 nativeCheckInputs = [
34 pytestCheckHook
35 pytest-mock
36 ] ++ passthru.optional-dependencies.timedelta ++ passthru.optional-dependencies.yaml;
37
38 disabledTests =
39 [ ]
40 ++ lib.optionals (pythonAtLeast "3.11") [
41 # Any/None internal changes, tests need adjusting upstream
42 "without_type_hinting"
43 "default_dict"
44 "test_frozenset"
45 "test_set"
46 "date_times_with_custom_pattern"
47 "from_dict_handles_identical_cased_json_keys"
48 ];
49
50 pythonImportsCheck = [ "dataclass_wizard" ];
51
52 meta = with lib; {
53 description = "Set of simple, yet elegant wizarding tools for interacting with the Python dataclasses module";
54 mainProgram = "wiz";
55 homepage = "https://github.com/rnag/dataclass-wizard";
56 changelog = "https://github.com/rnag/dataclass-wizard/releases/tag/v${version}";
57 license = licenses.asl20;
58 maintainers = with maintainers; [ codifryed ];
59 };
60}