pythonPackages.xmlsec: init at 1.3.9

+73
+47
pkgs/development/python-modules/xmlsec/default.nix
··· 1 + { lib 2 + , fetchPypi 3 + , buildPythonPackage 4 + , pytestCheckHook 5 + , libxslt 6 + , libxml2 7 + , libtool 8 + , pkg-config 9 + , xmlsec 10 + , pkgconfig 11 + , setuptools-scm 12 + , toml 13 + , lxml 14 + , hypothesis 15 + }: 16 + 17 + buildPythonPackage rec { 18 + pname = "xmlsec"; 19 + version = "1.3.9"; 20 + 21 + src = fetchPypi { 22 + inherit pname version; 23 + sha256 = "1c4k42zv3plm6v65p7z6l5rxyf50h40d02nhc16vq7cjrfvdf4rx"; 24 + }; 25 + 26 + # https://github.com/mehcode/python-xmlsec/issues/84#issuecomment-632930116 27 + patches = [ 28 + ./reset-lxml-in-tests.patch 29 + ]; 30 + 31 + nativeBuildInputs = [ pkg-config pkgconfig setuptools-scm toml ]; 32 + 33 + buildInputs = [ xmlsec libxslt libxml2 libtool ]; 34 + 35 + propagatedBuildInputs = [ lxml ]; 36 + 37 + # Full git clone required for test_doc_examples 38 + checkInputs = [ pytestCheckHook hypothesis ]; 39 + disabledTestPaths = [ "tests/test_doc_examples.py" ]; 40 + 41 + meta = with lib; { 42 + description = "Python bindings for the XML Security Library"; 43 + homepage = "https://github.com/mehcode/python-xmlsec"; 44 + license = licenses.mit; 45 + maintainers = with maintainers; [ zhaofengli ]; 46 + }; 47 + }
+22
pkgs/development/python-modules/xmlsec/reset-lxml-in-tests.patch
··· 1 + diff --git a/tests/base.py b/tests/base.py 2 + index b05de1d..5ec356f 100644 3 + --- a/tests/base.py 4 + +++ b/tests/base.py 5 + @@ -94,6 +94,7 @@ class TestMemoryLeaks(unittest.TestCase): 6 + 7 + def load_xml(self, name, xpath=None): 8 + """returns xml.etree""" 9 + + etree.set_default_parser(parser=etree.XMLParser()) 10 + root = etree.parse(self.path(name)).getroot() 11 + if xpath is None: 12 + return root 13 + diff --git a/tests/test_doc_examples.py b/tests/test_doc_examples.py 14 + index 2fc490f..53d2377 100644 15 + --- a/tests/test_doc_examples.py 16 + +++ b/tests/test_doc_examples.py 17 + @@ -42,3 +42,5 @@ def test_doc_example(example): 18 + """ 19 + with cd(example.parent): 20 + runpy.run_path(str(example)) 21 + + from lxml import etree 22 + + etree.set_default_parser(parser=etree.XMLParser())
+4
pkgs/top-level/python-packages.nix
··· 8632 8632 8633 8633 xmlschema = callPackage ../development/python-modules/xmlschema { }; 8634 8634 8635 + xmlsec = callPackage ../development/python-modules/xmlsec { 8636 + inherit (pkgs) libxslt libxml2 libtool pkg-config xmlsec; 8637 + }; 8638 + 8635 8639 xmltodict = callPackage ../development/python-modules/xmltodict { }; 8636 8640 8637 8641 xmodem = callPackage ../development/python-modules/xmodem { };