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 optional-dependencies = { 29 timedelta = [ pytimeparse ]; 30 yaml = [ pyyaml ]; 31 }; 32 33 nativeCheckInputs = 34 [ 35 pytestCheckHook 36 pytest-mock 37 ] 38 ++ optional-dependencies.timedelta 39 ++ optional-dependencies.yaml; 40 41 disabledTests = 42 [ ] 43 ++ lib.optionals (pythonAtLeast "3.11") [ 44 # Any/None internal changes, tests need adjusting upstream 45 "without_type_hinting" 46 "default_dict" 47 "test_frozenset" 48 "test_set" 49 "date_times_with_custom_pattern" 50 "from_dict_handles_identical_cased_json_keys" 51 ]; 52 53 pythonImportsCheck = [ "dataclass_wizard" ]; 54 55 meta = with lib; { 56 description = "Set of simple, yet elegant wizarding tools for interacting with the Python dataclasses module"; 57 mainProgram = "wiz"; 58 homepage = "https://github.com/rnag/dataclass-wizard"; 59 changelog = "https://github.com/rnag/dataclass-wizard/releases/tag/v${version}"; 60 license = licenses.asl20; 61 maintainers = with maintainers; [ codifryed ]; 62 }; 63}