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