1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 pytest-mock,
6 pytestCheckHook,
7 python-dotenv,
8 pythonAtLeast,
9 pythonOlder,
10 pytimeparse,
11 pyyaml,
12 setuptools,
13 typing-extensions,
14 tomli-w,
15}:
16
17buildPythonPackage rec {
18 pname = "dataclass-wizard";
19 version = "0.35.1";
20 pyproject = true;
21
22 src = fetchFromGitHub {
23 owner = "rnag";
24 repo = "dataclass-wizard";
25 tag = "v${version}";
26 hash = "sha256-GnD0Rxvy46+SLP5oFYVPO4+4VSBAPPRip//8e7xyylA=";
27 };
28
29 build-system = [ setuptools ];
30
31 dependencies = [ typing-extensions ];
32
33 optional-dependencies = {
34 dotenv = [ python-dotenv ];
35 timedelta = [ pytimeparse ];
36 toml = [ tomli-w ];
37 yaml = [ pyyaml ];
38 };
39
40 nativeCheckInputs = [
41 pytestCheckHook
42 pytest-mock
43 ]
44 ++ lib.flatten (builtins.attrValues optional-dependencies);
45
46 disabledTests =
47 [ ]
48 ++ lib.optionals (pythonAtLeast "3.11") [
49 # Any/None internal changes, tests need adjusting upstream
50 "without_type_hinting"
51 "default_dict"
52 "test_frozenset"
53 "test_set"
54 "date_times_with_custom_pattern"
55 "from_dict_handles_identical_cased_json_keys"
56 ];
57
58 pythonImportsCheck = [ "dataclass_wizard" ];
59
60 meta = with lib; {
61 description = "Wizarding tools for interacting with the Python dataclasses module";
62 homepage = "https://github.com/rnag/dataclass-wizard";
63 changelog = "https://github.com/rnag/dataclass-wizard/releases/tag/${src.tag}";
64 license = licenses.asl20;
65 maintainers = with maintainers; [ codifryed ];
66 mainProgram = "wiz";
67 };
68}