Open kloczek opened 2 years ago
I'm not sure but it maybe because I'm using relatively fresh lxml
version
Here is pytest output:
@kloczek this should be amended by #212 which is in master branch now. Can you rerun the tests from the current master?
OK .. one sec 😄
With all master commits:
Source: %{VCS}/archive/%{version}/%{name}-%{version}.tar.gz
Patch: %{VCS}/commit/cf38b52c.patch#/%{name}-exclude-lxml-4.7-because-the-wheels-are-missing-the-.patch
Patch: %{VCS}/commit/9acc1538.patch#/%{name}-remove-pkgconfig-as-it-s-only-a-build-system-require.patch
Patch: %{VCS}/commit/154c51df.patch#/%{name}-use-build-to-build-wheels.patch
Patch: %{VCS}/commit/a65be810.patch#/%{name}-Switch-on-modern-headers-lxml.patch
Patch: %{VCS}/commit/bf6984a5.patch#/%{name}-setup.py-Fix-typo-in-PYXMLSEC_LIBXSLT_VERSION.patch
Patch: %{VCS}/commit/5c6bbdb8.patch#/%{name}-renew-sources-for-source-dists.patch
Patch: %{VCS}/commit/811c5cca.patch#/%{name}-remove-libxml2-pin-in-manylinux2010-sdist-jobs.patch
Patch: %{VCS}/commit/1858a467.patch#/%{name}-bump-github-actions-versions.patch
Patch: %{VCS}/commit/8393c7a9.patch#/%{name}-workaround-for-https-github.com-actions-runner-issue.patch
Patch: %{VCS}/commit/8551a4f4.patch#/%{name}-bump-gcc-5-symlink-in-linuxbrew-job.patch
Patch: %{VCS}/commit/3ebbed8f.patch#/%{name}-bump-python-3.9-to-latest-patch-in-appveyor-ci.patch
Patch: %{VCS}/commit/bc30efd4.patch#/%{name}-Resolve-key-loading-issue-on-big-endian-systems.patch
Patch: %{VCS}/commit/b04a7628.patch#/%{name}-xmlsec-workaround-for-gh-mehcode-python-xmlsec-84.patch
Patch: %{VCS}/commit/ceaea9c9.patch#/%{name}-regenerate-stubs-amend-according-to-flake8-pyi-ensur.patch
Patch: %{VCS}/commit/7d139b39.patch#/%{name}-fix-unwanted-replacement-with-sed.patch
Patch: %{VCS}/commit/d5f53064.patch#/%{name}-drop-unused-imports-in-stub-generation-test.patch
Patch: %{VCS}/commit/ca566bbf.patch#/%{name}-mark-constants-with-no-href-with-special-type-in-stu.patch
Patch: %{VCS}/commit/20be5766.patch#/%{name}-add-explicit-export-for-constants-module.patch
Patch: %{VCS}/commit/e8ec6535.patch#/%{name}-skip-stub-generation-test-on-windows.patch
Patch: %{VCS}/commit/40620366.patch#/%{name}-introduce-pre-commit.patch
Patch: %{VCS}/commit/e2a369c9.patch#/%{name}-fix-libxml2-libxslt-version-parsing-in-setup-script.patch
Patch: %{VCS}/commit/370b250a.patch#/%{name}-use-python-3.9-in-rtd-docs-builds.patch
Now is way better but still I see 3 units failing
+ PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-xmlsec-1.3.12-4.fc35.x86_64/usr/lib64/python3.8/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-xmlsec-1.3.12-4.fc35.x86_64/usr/lib/python3.8/site-packages
+ /usr/bin/pytest -ra
=========================================================================== test session starts ============================================================================
platform linux -- Python 3.8.13, pytest-7.1.2, pluggy-1.0.0
rootdir: /home/tkloczko/rpmbuild/BUILD/python-xmlsec-1.3.12
plugins: hypothesis-6.41.0
collected 171 items / 1 skipped
tests/test_xmlsec.py . [ 0%]
tests/test_constants.py .... [ 2%]
tests/test_doc_examples.py .FF.F. [ 6%]
tests/test_ds.py ........................................ [ 29%]
tests/test_enc.py ........................ [ 43%]
tests/test_keys.py ......................................... [ 67%]
tests/test_main.py ............. [ 75%]
tests/test_templates.py .................................. [ 95%]
tests/test_tree.py ........ [100%]
================================================================================= FAILURES =================================================================================
_______________________________________________________________________ test_doc_example[encrypt.py] _______________________________________________________________________
example = PosixPath('/home/tkloczko/rpmbuild/BUILD/python-xmlsec-1.3.12/doc/source/examples/encrypt.py')
@pytest.mark.parametrize('example', examples, ids=lambda p: p.name)
def test_doc_example(example):
"""
Verify example scripts included in the docs are up to date.
Execute each script in :file:`docs/source/examples`,
not raising any errors is good enough.
"""
with cd(example.parent):
> runpy.run_path(str(example))
tests/test_doc_examples.py:44:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/usr/lib64/python3.8/runpy.py:265: in run_path
return _run_module_code(code, init_globals, run_name,
/usr/lib64/python3.8/runpy.py:97: in _run_module_code
_run_code(code, mod_globals, init_globals,
/usr/lib64/python3.8/runpy.py:87: in _run_code
exec(code, run_globals)
doc/source/examples/encrypt.py:8: in <module>
template = etree.parse('enc1-doc.xml').getroot()
src/lxml/etree.pyx:3538: in lxml.etree.parse
???
src/lxml/parser.pxi:1876: in lxml.etree._parseDocument
???
src/lxml/parser.pxi:1902: in lxml.etree._parseDocumentFromURL
???
src/lxml/parser.pxi:1805: in lxml.etree._parseDocFromFile
???
src/lxml/parser.pxi:1177: in lxml.etree._BaseParser._parseDocFromFile
???
src/lxml/parser.pxi:615: in lxml.etree._ParserContext._handleParseResultDoc
???
src/lxml/parser.pxi:725: in lxml.etree._handleParseResult
???
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
> ???
E File "b'enc1-doc.xml'", line 0
E lxml.etree.XMLSyntaxError: <no detail available>
src/lxml/parser.pxi:665: XMLSyntaxError
--------------------------------------------------------------------------- Captured stderr call ---------------------------------------------------------------------------
func=xmlSecNoXxeExternalEntityLoader:file=xmlsec.c:line=58:obj=unknown:subj=xmlSecNoXxeExternalEntityLoader:error=5:libxml2 library function failed:illegal external entity='enc1-doc.xml'; xml error: 0: NULL
________________________________________________________________________ test_doc_example[sign.py] _________________________________________________________________________
example = PosixPath('/home/tkloczko/rpmbuild/BUILD/python-xmlsec-1.3.12/doc/source/examples/sign.py')
@pytest.mark.parametrize('example', examples, ids=lambda p: p.name)
def test_doc_example(example):
"""
Verify example scripts included in the docs are up to date.
Execute each script in :file:`docs/source/examples`,
not raising any errors is good enough.
"""
with cd(example.parent):
> runpy.run_path(str(example))
tests/test_doc_examples.py:44:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/usr/lib64/python3.8/runpy.py:265: in run_path
return _run_module_code(code, init_globals, run_name,
/usr/lib64/python3.8/runpy.py:97: in _run_module_code
_run_code(code, mod_globals, init_globals,
/usr/lib64/python3.8/runpy.py:87: in _run_code
exec(code, run_globals)
doc/source/examples/sign.py:5: in <module>
template = etree.parse('sign1-tmpl.xml').getroot()
src/lxml/etree.pyx:3538: in lxml.etree.parse
???
src/lxml/parser.pxi:1876: in lxml.etree._parseDocument
???
src/lxml/parser.pxi:1902: in lxml.etree._parseDocumentFromURL
???
src/lxml/parser.pxi:1805: in lxml.etree._parseDocFromFile
???
src/lxml/parser.pxi:1177: in lxml.etree._BaseParser._parseDocFromFile
???
src/lxml/parser.pxi:615: in lxml.etree._ParserContext._handleParseResultDoc
???
src/lxml/parser.pxi:725: in lxml.etree._handleParseResult
???
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
> ???
E File "b'sign1-tmpl.xml'", line 0
E lxml.etree.XMLSyntaxError: <no detail available>
src/lxml/parser.pxi:665: XMLSyntaxError
--------------------------------------------------------------------------- Captured stderr call ---------------------------------------------------------------------------
func=xmlSecNoXxeExternalEntityLoader:file=xmlsec.c:line=58:obj=unknown:subj=xmlSecNoXxeExternalEntityLoader:error=5:libxml2 library function failed:illegal external entity='sign1-tmpl.xml'; xml error: 0: NULL
_______________________________________________________________________ test_doc_example[verify.py] ________________________________________________________________________
example = PosixPath('/home/tkloczko/rpmbuild/BUILD/python-xmlsec-1.3.12/doc/source/examples/verify.py')
@pytest.mark.parametrize('example', examples, ids=lambda p: p.name)
def test_doc_example(example):
"""
Verify example scripts included in the docs are up to date.
Execute each script in :file:`docs/source/examples`,
not raising any errors is good enough.
"""
with cd(example.parent):
> runpy.run_path(str(example))
tests/test_doc_examples.py:44:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/usr/lib64/python3.8/runpy.py:265: in run_path
return _run_module_code(code, init_globals, run_name,
/usr/lib64/python3.8/runpy.py:97: in _run_module_code
_run_code(code, mod_globals, init_globals,
/usr/lib64/python3.8/runpy.py:87: in _run_code
exec(code, run_globals)
doc/source/examples/verify.py:5: in <module>
template = etree.parse('sign1-res.xml').getroot()
src/lxml/etree.pyx:3538: in lxml.etree.parse
???
src/lxml/parser.pxi:1876: in lxml.etree._parseDocument
???
src/lxml/parser.pxi:1902: in lxml.etree._parseDocumentFromURL
???
src/lxml/parser.pxi:1805: in lxml.etree._parseDocFromFile
???
src/lxml/parser.pxi:1177: in lxml.etree._BaseParser._parseDocFromFile
???
src/lxml/parser.pxi:615: in lxml.etree._ParserContext._handleParseResultDoc
???
src/lxml/parser.pxi:725: in lxml.etree._handleParseResult
???
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
> ???
E File "b'sign1-res.xml'", line 0
E lxml.etree.XMLSyntaxError: <no detail available>
src/lxml/parser.pxi:665: XMLSyntaxError
--------------------------------------------------------------------------- Captured stderr call ---------------------------------------------------------------------------
func=xmlSecNoXxeExternalEntityLoader:file=xmlsec.c:line=58:obj=unknown:subj=xmlSecNoXxeExternalEntityLoader:error=5:libxml2 library function failed:illegal external entity='sign1-res.xml'; xml error: 0: NULL
========================================================================= short test summary info ==========================================================================
SKIPPED [1] tests/test_type_stubs.py:9: could not import 'black': No module named 'black'
FAILED tests/test_doc_examples.py::test_doc_example[encrypt.py] - File "b'enc1-doc.xml'", line 0
FAILED tests/test_doc_examples.py::test_doc_example[sign.py] - File "b'sign1-tmpl.xml'", line 0
FAILED tests/test_doc_examples.py::test_doc_example[verify.py] - File "b'sign1-res.xml'", line 0
================================================================= 3 failed, 168 passed, 1 skipped in 9.42s =================================================================
So in my spm sepc file I'll keep those there units still deselected 😄
%check
%pytest %{!?with_failing_tests: \
--deselect tests/test_doc_examples.py::test_doc_example[encrypt.py] \
--deselect tests/test_doc_examples.py::test_doc_example[sign.py] \
--deselect tests/test_doc_examples.py::test_doc_example[verify.py] \
}
I found another issue related to documentation. I'm no longer able to generate man page.
+ /usr/bin/sphinx-build -n -T -b man doc/source build/sphinx/man
Running Sphinx v5.1.1
Traceback (most recent call last):
File "/usr/lib/python3.8/site-packages/sphinx/config.py", line 347, in eval_config_file
exec(code, namespace)
File "/home/tkloczko/rpmbuild/BUILD/python-xmlsec-1.3.12/doc/source/conf.py", line 39, in <module>
exclude_patterns: list[str] = []
TypeError: 'type' object is not subscriptable
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/usr/lib/python3.8/site-packages/sphinx/cmd/build.py", line 272, in build_main
app = Sphinx(args.sourcedir, args.confdir, args.outputdir,
File "/usr/lib/python3.8/site-packages/sphinx/application.py", line 201, in __init__
self.config = Config.read(self.confdir, confoverrides or {}, self.tags)
File "/usr/lib/python3.8/site-packages/sphinx/config.py", line 169, in read
namespace = eval_config_file(filename, tags)
File "/usr/lib/python3.8/site-packages/sphinx/config.py", line 360, in eval_config_file
raise ConfigError(msg % traceback.format_exc()) from exc
sphinx.errors.ConfigError: There is a programmable error in your configuration file:
Traceback (most recent call last):
File "/usr/lib/python3.8/site-packages/sphinx/config.py", line 347, in eval_config_file
exec(code, namespace)
File "/home/tkloczko/rpmbuild/BUILD/python-xmlsec-1.3.12/doc/source/conf.py", line 39, in <module>
exclude_patterns: list[str] = []
TypeError: 'type' object is not subscriptable
Configuration error:
There is a programmable error in your configuration file:
Traceback (most recent call last):
File "/usr/lib/python3.8/site-packages/sphinx/config.py", line 347, in eval_config_file
exec(code, namespace)
File "/home/tkloczko/rpmbuild/BUILD/python-xmlsec-1.3.12/doc/source/conf.py", line 39, in <module>
exclude_patterns: list[str] = []
TypeError: 'type' object is not subscriptable
Forgot about one datail. To be able straight use call it like below:
PYTHONPATH=$PWD/build/$(cd build; ls -d1 lib*) /usr/bin/sphinx-build -n -T -b man doc/source build/sphinx/man
.. after build
@kloczek are you using python 3.8 or less in doc build?
Yes 3.8.13.
Ah, I missed a from __future__ import annotations
in the conf.py
; wasn't aware that the docs are built somewhere with older Python versions. Will amend shortly.
Just tested new version
++ cd build
++ ls -d1 lib.linux-x86_64-cpython-38
+ PYTHONPATH=/home/tkloczko/rpmbuild/BUILD/python-xmlsec-1.3.12/build/lib.linux-x86_64-cpython-38
+ PBR_VERSION=1.3.12
+ PDM_PEP517_SCM_VERSION=1.3.12
+ SETUPTOOLS_SCM_PRETEND_VERSION=1.3.12
+ /usr/bin/sphinx-build -n -T -b man doc/source build/sphinx/man
Running Sphinx v5.1.1
WARNING: Invalid configuration value found: 'language = None'. Update your configuration to a valid language code. Falling back to 'en' (English).
making output directory... done
loading intersphinx inventory from https://docs.python.org/3/objects.inv...
building [mo]: targets for 0 po files that are out of date
building [man]: all manpages
updating environment: [new config] 8 added, 0 changed, 0 removed
reading sources... [100%] modules/xmlsec
looking for now-outdated files... none found
pickling environment... done
checking consistency... done
writing... python-xmlsec.3 { install api modules/xmlsec modules/constants modules/template modules/tree examples } /home/tkloczko/rpmbuild/BUILD/python-xmlsec-1.3.12/docstring of xmlsec.register_callbacks:1: WARNING: py:class reference target not found: callable
/home/tkloczko/rpmbuild/BUILD/python-xmlsec-1.3.12/docstring of xmlsec.register_callbacks:1: WARNING: py:class reference target not found: callable
/home/tkloczko/rpmbuild/BUILD/python-xmlsec-1.3.12/docstring of xmlsec.register_callbacks:1: WARNING: py:class reference target not found: callable
/home/tkloczko/rpmbuild/BUILD/python-xmlsec-1.3.12/docstring of xmlsec.register_callbacks:1: WARNING: py:class reference target not found: callable
done
build succeeded, 5 warnings.
You can peak on fixes that kind of issues in other projects https://github.com/latchset/jwcrypto/pull/289 https://github.com/click-contrib/sphinx-click/commit/abc31069 https://github.com/latchset/jwcrypto/pull/289 https://github.com/RDFLib/rdflib-sqlalchemy/issues/95 https://github.com/sissaschool/elementpath/commit/bf869d9e https://github.com/jaraco/cssutils/issues/21 https://github.com/pywbem/pywbem/pull/2895 https://github.com/sissaschool/xmlschema/commit/42ea98f2 https://github.com/RDFLib/rdflib/pull/2036 https://github.com/frostming/unearth/issues/14
And pytest is failing again
Second part of the log
You are still missing the patch from #212.
The tests for doc examples are also adjusted to the change in #212 now and shouldn't fail.
Just tested 1.3.13 + master and still I see two units failing Here is pytest output:
Here is updated list of installed modules in build env
I'm packaging your module as an rpm package so I'm using the typical PEP517 based build, install and test cycle used on building packages from non-root account.
python3 -sBm build -w --no-isolation
build
with--no-isolation
I'm using during all processes only locally installed modulesList of modules installed in build env