Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{ lib 2, buildPythonPackage 3, pythonOlder 4, fetchPypi 5, fetchpatch 6, click 7, click-default-group 8, docformatter 9, jinja2 10, toposort 11, lxml 12, requests 13, pytestCheckHook 14}: 15 16buildPythonPackage rec { 17 pname = "xsdata"; 18 version = "22.12"; 19 20 disabled = pythonOlder "3.7"; 21 22 format = "setuptools"; 23 24 src = fetchPypi { 25 inherit pname version; 26 hash = "sha256-o9Xxt7b/+MkW94Jcg26ihaTn0/OpTcu+0OY7oV3JRGY="; 27 }; 28 29 patches = [ 30 # https://github.com/tefra/xsdata/pull/741 31 (fetchpatch { 32 name = "use-docformatter-1.5.1.patch"; 33 url = "https://github.com/tefra/xsdata/commit/040692db47e6e51028fd959c793e757858c392d7.patch"; 34 excludes = [ "setup.cfg" ]; 35 hash = "sha256-ncecMJLJUiUb4lB8ys+nyiGU/UmayK++o89h3sAwREQ="; 36 }) 37 ]; 38 39 postPatch = '' 40 substituteInPlace setup.cfg \ 41 --replace "--benchmark-skip" "" 42 ''; 43 44 passthru.optional-dependencies = { 45 cli = [ 46 click 47 click-default-group 48 docformatter 49 jinja2 50 toposort 51 ]; 52 lxml = [ 53 lxml 54 ]; 55 soap = [ 56 requests 57 ]; 58 }; 59 60 nativeCheckInputs = [ 61 pytestCheckHook 62 ] ++ passthru.optional-dependencies.cli 63 ++ passthru.optional-dependencies.lxml 64 ++ passthru.optional-dependencies.soap; 65 66 disabledTestPaths = [ 67 "tests/integration/benchmarks" 68 ]; 69 70 pythonImportsCheck = [ 71 "xsdata.formats.dataclass.context" 72 "xsdata.formats.dataclass.models.elements" 73 "xsdata.formats.dataclass.models.generics" 74 "xsdata.formats.dataclass.parsers" 75 "xsdata.formats.dataclass.parsers.handlers" 76 "xsdata.formats.dataclass.parsers.nodes" 77 "xsdata.formats.dataclass.serializers" 78 "xsdata.formats.dataclass.serializers.config" 79 "xsdata.formats.dataclass.serializers.mixins" 80 "xsdata.formats.dataclass.serializers.writers" 81 "xsdata.models.config" 82 "xsdata.utils.text" 83 ]; 84 85 meta = { 86 description = "Python XML Binding"; 87 homepage = "https://github.com/tefra/xsdata"; 88 changelog = "https://github.com/tefra/xsdata/blob/v${version}/CHANGES.rst"; 89 license = lib.licenses.mit; 90 maintainers = with lib.maintainers; [ dotlambda ]; 91 }; 92}