blob: ed4bc835a634612986a39ea6e14f1c5170f60487 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
|
{
lib,
fetchFromGitHub,
buildPythonPackage,
pytestCheckHook,
pythonAtLeast,
setuptools,
}:
buildPythonPackage rec {
pname = "dacite";
version = "1.9.2";
pyproject = true;
src = fetchFromGitHub {
owner = "konradhalas";
repo = "dacite";
tag = "v${version}";
hash = "sha256-mAPqWvBpkTbtzHpwtCSDXMNkoc8/hbRH3OIEeK2yStU=";
};
postPatch = ''
substituteInPlace pyproject.toml \
--replace "--benchmark-autosave --benchmark-json=benchmark.json" ""
''
+ lib.optionalString (pythonAtLeast "3.14") ''
substituteInPlace tests/core/test_union.py \
--replace-fail "typing.Union[int, str]" "int | str"
'';
build-system = [ setuptools ];
nativeCheckInputs = [ pytestCheckHook ];
pythonImportsCheck = [ "dacite" ];
disabledTestPaths = [ "tests/performance" ];
meta = {
description = "Python helper to create data classes from dictionaries";
homepage = "https://github.com/konradhalas/dacite";
changelog = "https://github.com/konradhalas/dacite/blob/v${version}/CHANGELOG.md";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ fab ];
};
}
|