nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 replaceVars,
6 ruff,
7 click,
8 jinja2,
9 toposort,
10 typing-extensions,
11 lxml,
12 requests,
13 pytestCheckHook,
14 setuptools,
15}:
16
17buildPythonPackage rec {
18 pname = "xsdata";
19 version = "26.1";
20 pyproject = true;
21
22 src = fetchFromGitHub {
23 owner = "tefra";
24 repo = "xsdata";
25 tag = "v${version}";
26 hash = "sha256-cMXLRk74y+yHYyIQqlUcMZawNfMXa5L17qhVkTpgEsk=";
27 };
28
29 patches = [
30 (replaceVars ./paths.patch {
31 ruff = lib.getExe ruff;
32 })
33 ];
34
35 postPatch = ''
36 substituteInPlace pyproject.toml \
37 --replace-fail "--benchmark-skip" ""
38 '';
39
40 build-system = [ setuptools ];
41
42 dependencies = [ typing-extensions ];
43
44 optional-dependencies = {
45 cli = [
46 click
47 jinja2
48 toposort
49 ];
50 lxml = [ lxml ];
51 soap = [ requests ];
52 };
53
54 nativeCheckInputs = [
55 pytestCheckHook
56 ]
57 ++ lib.concatAttrValues optional-dependencies;
58
59 disabledTestPaths = [ "tests/integration/benchmarks" ];
60
61 pythonImportsCheck = [
62 "xsdata.formats.dataclass.context"
63 "xsdata.formats.dataclass.models.elements"
64 "xsdata.formats.dataclass.models.generics"
65 "xsdata.formats.dataclass.parsers"
66 "xsdata.formats.dataclass.parsers.handlers"
67 "xsdata.formats.dataclass.parsers.nodes"
68 "xsdata.formats.dataclass.serializers"
69 "xsdata.formats.dataclass.serializers.config"
70 "xsdata.formats.dataclass.serializers.mixins"
71 "xsdata.formats.dataclass.serializers.writers"
72 "xsdata.models.config"
73 "xsdata.utils.text"
74 ];
75
76 meta = {
77 description = "Naive XML & JSON bindings for Python";
78 mainProgram = "xsdata";
79 homepage = "https://github.com/tefra/xsdata";
80 changelog = "https://github.com/tefra/xsdata/blob/${src.tag}/CHANGES.md";
81 license = lib.licenses.mit;
82 maintainers = with lib.maintainers; [ dotlambda ];
83 };
84}