Closed kloczek closed 2 years ago
@kloczek Can you try it on 6.1.1 instead?
Just tested 6.1.1 and pytest still fails in the same unit.
+ PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-rdflib-6.1.1-2.fc35.x86_64/usr/lib64/python3.8/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-rdflib-6.1.1-2.fc35.x86_64/usr/lib/python3.8/site-packages
+ /usr/bin/pytest -ra
=========================================================================== test session starts ============================================================================
platform linux -- Python 3.8.12, pytest-6.2.5, py-1.11.0, pluggy-1.0.0
rootdir: /home/tkloczko/rpmbuild/BUILD/rdflib-6.1.1, configfile: setup.cfg
collected 4040 items
rdflib/__init__.py . [ 0%]
rdflib/collection.py .... [ 0%]
rdflib/compare.py .. [ 0%]
rdflib/container.py . [ 0%]
rdflib/events.py . [ 0%]
rdflib/graph.py ........ [ 0%]
rdflib/parser.py . [ 0%]
rdflib/paths.py . [ 0%]
rdflib/query.py . [ 0%]
rdflib/resource.py . [ 0%]
rdflib/term.py .............. [ 0%]
rdflib/util.py ..... [ 0%]
rdflib/extras/describer.py ...... [ 1%]
rdflib/extras/infixowl.py .......... [ 1%]
rdflib/namespace/__init__.py ..... [ 1%]
rdflib/plugins/parsers/jsonld.py . [ 1%]
rdflib/plugins/parsers/notation3.py ... [ 1%]
rdflib/plugins/parsers/nquads.py . [ 1%]
rdflib/plugins/serializers/jsonld.py . [ 1%]
rdflib/plugins/shared/jsonld/util.py . [ 1%]
rdflib/plugins/stores/sparqlstore.py . [ 1%]
rdflib/tools/csv2rdf.py . [ 1%]
rdflib/tools/rdfpipe.py . [ 1%]
test/helper.py . [ 1%]
test/test_980.py . [ 1%]
test/test_aggregate_graphs.py . [ 1%]
test/test_auditable.py ........................ [ 2%]
test/test_b64_binary.py . [ 2%]
test/test_batch_add.py .......... [ 2%]
test/test_bnode_ncname.py . [ 2%]
test/test_canonicalization.py ..........x [ 2%]
test/test_comparison.py .......... [ 3%]
test/test_conjunctive_graph.py .... [ 3%]
test/test_container.py ................. [ 3%]
test/test_conventions.py . [ 3%]
test/test_create_input_source.py .. [ 3%]
test/test_csv2rdf.py .. [ 3%]
test/test_dataset.py ssssssss.... [ 4%]
test/test_datetime.py ....... [ 4%]
test/test_dawg.py .........................................ss....................................................................................................... [ 7%]
.................................................................................................................................................................... [ 12%]
.........................................................s...s....ss..ssssssssssss....ssss...........ss..sss.sss..sssssssssssssss................................... [ 16%]
.........................................................................................sssssss.................................................................... [ 20%]
............................................................................................................................... [ 23%]
test/test_definednamespace_creator.py ... [ 23%]
test/test_diff.py ..x [ 23%]
test/test_duration.py ...... [ 23%]
test/test_empty_xml_base.py .. [ 23%]
test/test_evaluate_bind.py ... [ 23%]
test/test_events.py . [ 23%]
test/test_expressions.py ...... [ 23%]
test/test_extras_external_graph_libs.py ss [ 23%]
test/test_finalnewline.py . [ 23%]
test/test_graph.py ssssssssss.......... [ 24%]
test/test_graph_cbd.py .. [ 24%]
test/test_graph_context.py ssssssssss.......... [ 25%]
test/test_graph_formula.py ..s [ 25%]
test/test_graph_http.py .... [ 25%]
test/test_graph_items.py . [ 25%]
test/test_graph_operator.py ... [ 25%]
test/test_hex_binary.py .. [ 25%]
test/test_initbindings.py .......................... [ 25%]
test/test_issue084.py ........ [ 26%]
test/test_issue1003.py . [ 26%]
test/test_issue1043.py . [ 26%]
test/test_issue1141.py ... [ 26%]
test/test_issue1160.py . [ 26%]
test/test_issue1404.py . [ 26%]
test/test_issue1484.py .. [ 26%]
test/test_issue160.py . [ 26%]
test/test_issue161.py . [ 26%]
test/test_issue184.py . [ 26%]
test/test_issue190.py xx [ 26%]
test/test_issue200.py . [ 26%]
test/test_issue209.py . [ 26%]
test/test_issue223.py . [ 26%]
test/test_issue247.py .. [ 26%]
test/test_issue248.py . [ 26%]
test/test_issue274.py ................................. [ 27%]
test/test_issue363.py .. [ 27%]
test/test_issue379.py .. [ 27%]
test/test_issue381.py ....... [ 27%]
test/test_issue432.py . [ 27%]
test/test_issue446.py . [ 27%]
test/test_issue492.py . [ 27%]
test/test_issue523.py . [ 27%]
test/test_issue532.py . [ 27%]
test/test_issue535.py . [ 27%]
test/test_issue545.py . [ 27%]
test/test_issue554.py . [ 27%]
test/test_issue563.py .. [ 27%]
test/test_issue579.py . [ 28%]
test/test_issue604.py . [ 28%]
test/test_issue655.py . [ 28%]
test/test_issue715.py . [ 28%]
test/test_issue733.py .. [ 28%]
test/test_issue801.py . [ 28%]
test/test_issue893.py . [ 28%]
test/test_issue910.py .... [ 28%]
test/test_issue920.py . [ 28%]
test/test_issue923.py . [ 28%]
test/test_issue953.py . [ 28%]
test/test_issue977.py .. [ 28%]
test/test_issue_git_200.py . [ 28%]
test/test_issue_git_336.py . [ 28%]
test/test_literal.py ........................x [ 29%]
test/test_memory_store.py .. [ 29%]
test/test_mulpath_n3.py . [ 29%]
test/test_n3.py ................ [ 29%]
test/test_n3_suite.py ............................................................ [ 31%]
test/test_namespace.py ........x.......... [ 31%]
test/test_nodepickler.py ... [ 31%]
test/test_normalizedString.py .... [ 31%]
test/test_nquads.py ........... [ 31%]
test/test_nquads_w3c.py ..................................................................................... [ 34%]
test/test_nt_misc.py ...................... [ 34%]
test/test_nt_w3c.py ................................................ [ 35%]
test/test_parse_file_guess_format.py .... [ 35%]
test/test_parser.py .... [ 35%]
test/test_parser_helpers.py . [ 36%]
test/test_parser_hext.py .... [ 36%]
test/test_parser_reads_from_pathlike_object.py . [ 36%]
test/test_parser_structure.py . [ 36%]
test/test_path_div_future.py . [ 36%]
test/test_prefixTypes.py . [ 36%]
test/test_preflabel.py ..... [ 36%]
test/test_prettyxml.py ....... [ 36%]
test/test_rdf_lists.py .. [ 36%]
test/test_rdfxml.py .. [ 36%]
test/test_roundtrip.py ............................................................................................................................................. [ 40%]
.................................................................................................................................................................... [ 44%]
.................................................................................................................................................................... [ 48%]
.................................................................................................................................................................... [ 52%]
.................................................................................................................................................................... [ 56%]
.................................................................................................................................................................... [ 60%]
.................................................................................................................................................................... [ 64%]
.................................................................................................................................................................... [ 68%]
....... [ 68%]
test/test_seq.py .. [ 68%]
test/test_serializer.py .... [ 68%]
test/test_serializer_hext.py ..... [ 68%]
test/test_serializer_longturtle.py . [ 68%]
test/test_serializer_trix.py .. [ 69%]
test/test_serializer_turtle.py ..... [ 69%]
test/test_serializer_xml.py ..... [ 69%]
test/test_slice.py . [ 69%]
test/test_sparql.py ......... [ 69%]
test/test_sparql_agg_distinct.py .... [ 69%]
test/test_sparql_agg_undef.py ....... [ 69%]
test/test_sparql_construct_bindings.py . [ 69%]
test/test_sparql_datetime.py .... [ 69%]
test/test_sparql_operators.py ... [ 70%]
test/test_sparql_parser.py .. [ 70%]
test/test_sparql_service.py ....... [ 70%]
test/test_sparqlstore.py ........ [ 70%]
test/test_sparqlupdatestore.py ssssssssssss [ 70%]
test/test_sparqlupdatestore_mock.py . [ 70%]
test/test_store.py .. [ 70%]
test/test_store_berkeleydb.py ssssss [ 70%]
test/test_swap_n3.py .s.ss.ss.....ss.s..ss.sss..... [ 71%]
test/test_term.py ....... [ 71%]
test/test_testutils.py ................. [ 72%]
test/test_tokendatatype.py ..... [ 72%]
test/test_trig.py .........s. [ 72%]
test/test_trig_w3c.py .............................................................................................................................................. [ 76%]
.................................................................................................................................................................... [ 80%]
............................. [ 80%]
test/test_trix_parse.py ... [ 81%]
test/test_tsvresults.py . [ 81%]
test/test_turtle_sort_issue613.py .. [ 81%]
test/test_turtle_w3c.py ............................................................................................................................................ [ 84%]
................................................................................................................................................... [ 88%]
test/test_util.py ............................x............... [ 89%]
test/test_wide_python.py . [ 89%]
test/test_xmlliterals.py ...F [ 89%]
test/testutils.py .. [ 89%]
test/jsonld/test_api.py . [ 89%]
test/jsonld/test_compaction.py ........... [ 89%]
test/jsonld/test_context.py ................ [ 90%]
test/jsonld/test_localsuite.py .. [ 90%]
test/jsonld/test_named_graphs.py ... [ 90%]
test/jsonld/test_onedotone.py ...................................................................................................................................... [ 93%]
................................................................................................................................ [ 96%]
test/jsonld/test_pythonparse.py . [ 96%]
test/jsonld/test_testsuite.py ............................................................................................................................... [ 99%]
test/jsonld/test_util.py .x [100%]
================================================================================= FAILURES =================================================================================
_________________________________________________________________________________ testHTML _________________________________________________________________________________
def testHTML():
l1 = Literal("<msg>hello</msg>", datatype=RDF.XMLLiteral)
assert l1.value is not None, "xml must have been parsed"
assert l1.datatype == RDF.XMLLiteral, "literal must have right datatype"
l2 = Literal("<msg>hello</msg>", datatype=RDF.HTML)
> assert l2.value is not None, "xml must have been parsed"
E AssertionError: xml must have been parsed
E assert None is not None
E + where None = rdflib.term.Literal('<msg>hello</msg>', datatype=rdflib.term.URIRef('http://www.w3.org/1999/02/22-rdf-syntax-ns#HTML')).value
test/test_xmlliterals.py:86: AssertionError
============================================================================= warnings summary =============================================================================
rdflib/graph.py:1274: 62 warnings
test/test_canonicalization.py: 14 warnings
test/test_dawg.py: 902 warnings
test/test_prettyxml.py: 10 warnings
test/test_rdfxml.py: 2 warnings
test/test_serializer_xml.py: 10 warnings
/home/tkloczko/rpmbuild/BUILD/rdflib-6.1.1/rdflib/graph.py:1274: DeprecationWarning: graph.load() is deprecated, it will be removed in rdflib 6.0.0. Please use graph.parse() instead.
warn(
rdflib/graph.py: 5 warnings
test/test_preflabel.py: 5 warnings
/home/tkloczko/rpmbuild/BUILD/rdflib-6.1.1/rdflib/graph.py:833: DeprecationWarning: graph.preferredLabel() is deprecated and will be removed in rdflib 6.0.0.
warn(
rdflib/resource.py::rdflib.resource
rdflib/resource.py::rdflib.resource
rdflib/resource.py::rdflib.resource
/home/tkloczko/rpmbuild/BUILD/rdflib-6.1.1/rdflib/graph.py:774: DeprecationWarning: graph.label() is deprecated and will be removed in rdflib 6.0.0.
warn(
rdflib/resource.py::rdflib.resource
/home/tkloczko/rpmbuild/BUILD/rdflib-6.1.1/rdflib/graph.py:871: DeprecationWarning: graph.comment() is deprecated and will be removed in rdflib 6.0.0.
warn(
rdflib/resource.py::rdflib.resource
test/test_seq.py::SeqTestCase::testSeq
/home/tkloczko/rpmbuild/BUILD/rdflib-6.1.1/rdflib/graph.py:989: DeprecationWarning: graph.seq() is deprecated and will be removed in rdflib 6.0.0.
warn(
test/test_literal.py::TestParseBoolean::testNonFalseBoolean
/home/tkloczko/rpmbuild/BUILD/rdflib-6.1.1/rdflib/term.py:1437: UserWarning: Parsing weird boolean, 'abcd' does not map to True or False
warnings.warn(
test/test_literal.py::TestParseBoolean::testNonFalseBoolean
/home/tkloczko/rpmbuild/BUILD/rdflib-6.1.1/rdflib/term.py:1437: UserWarning: Parsing weird boolean, '10' does not map to True or False
warnings.warn(
test/test_n3_suite.py: 1 warning
test/test_roundtrip.py: 10 warnings
/home/tkloczko/rpmbuild/BUILD/rdflib-6.1.1/rdflib/term.py:1325: UserWarning: Serializing weird numerical rdflib.term.Literal('xy.z', datatype=rdflib.term.URIRef('http://www.w3.org/2001/XMLSchema#double'))
warnings.warn("Serializing weird numerical %r" % self)
test/test_n3_suite.py: 1 warning
test/test_roundtrip.py: 10 warnings
/home/tkloczko/rpmbuild/BUILD/rdflib-6.1.1/rdflib/term.py:1325: UserWarning: Serializing weird numerical rdflib.term.Literal('+1.0z', datatype=rdflib.term.URIRef('http://www.w3.org/2001/XMLSchema#double'))
warnings.warn("Serializing weird numerical %r" % self)
test/test_n3_suite.py: 1 warning
test/test_roundtrip.py: 10 warnings
/home/tkloczko/rpmbuild/BUILD/rdflib-6.1.1/rdflib/term.py:1325: UserWarning: Serializing weird numerical rdflib.term.Literal('ab.c', datatype=rdflib.term.URIRef('http://www.w3.org/2001/XMLSchema#double'))
warnings.warn("Serializing weird numerical %r" % self)
test/test_namespace.py::NamespacePrefixTest::test_closed_namespace
/home/tkloczko/rpmbuild/BUILD/rdflib-6.1.1/test/test_namespace.py:214: UserWarning: DefinedNamespace does not address deprecated properties
warn("DefinedNamespace does not address deprecated properties")
test/test_rdf_lists.py::OWLCollectionTest::testCollectionRDFXML
/home/tkloczko/rpmbuild/BUILD/rdflib-6.1.1/rdflib/plugins/serializers/rdfxml.py:277: UserWarning: Assertions on rdflib.term.BNode('Ncb8ac0279866435f8ebfcc4ff0d34e0c') other than RDF.first and RDF.rest are ignored ... including RDF.List
self.predicate(predicate, object, depth + 1)
test/test_util.py::TestUtilTermConvert::test_util_from_n3_expectliteralandlangdtype
/usr/lib64/python3.8/unittest/case.py:633: UserWarning: Code: fr is not defined in namespace XSD
method()
-- Docs: https://docs.pytest.org/en/stable/warnings.html
========================================================================= short test summary info ==========================================================================
SKIPPED [4] test/test_dataset.py:41: Dependencies for store 'BerkeleyDB' not available!
SKIPPED [1] test/test_dataset.py:134: No SPARQL endpoint for SPARQLUpdateStore (tests skipped)
SKIPPED [1] test/test_dataset.py:81: No SPARQL endpoint for SPARQLUpdateStore (tests skipped)
SKIPPED [1] test/test_dataset.py:173: No SPARQL endpoint for SPARQLUpdateStore (tests skipped)
SKIPPED [1] test/test_dataset.py:160: No SPARQL endpoint for SPARQLUpdateStore (tests skipped)
SKIPPED [50] test/test_dawg.py:348: Skipped
SKIPPED [2] test/test_dawg.py:211: Skipped
SKIPPED [1] test/test_extras_external_graph_libs.py:8: couldn't find networkx
SKIPPED [1] test/test_extras_external_graph_libs.py:57: couldn't find graph_tool
SKIPPED [10] test/test_graph.py:29: Dependencies for store 'BerkeleyDB' not available!
SKIPPED [10] test/test_graph_context.py:20: Dependencies for store 'BerkeleyDB' not available!
SKIPPED [1] test/test_graph_formula.py:27: Dependencies for store 'BerkeleyDB' not available!
SKIPPED [12] ../../../../../usr/lib/python3.8/site-packages/_pytest/unittest.py:153: http://localhost:3031 is unavailable.
SKIPPED [1] test/test_store_berkeleydb.py:89: skipping as berkleydb is missing
SKIPPED [1] test/test_store_berkeleydb.py:120: skipping as berkleydb is missing
SKIPPED [1] test/test_store_berkeleydb.py:55: skipping as berkleydb is missing
SKIPPED [1] test/test_store_berkeleydb.py:78: skipping as berkleydb is missing
SKIPPED [1] test/test_store_berkeleydb.py:64: skipping as berkleydb is missing
SKIPPED [1] test/test_store_berkeleydb.py:32: skipping as berkleydb is missing
SKIPPED [1] test/test_swap_n3.py:74: syntax_this_quantifiers skipped, known issue
SKIPPED [1] test/test_swap_n3.py:74: syntax_neg_keywords3 skipped, known issue
SKIPPED [1] test/test_swap_n3.py:74: syntax_equals1 skipped, known issue
SKIPPED [1] test/test_swap_n3.py:74: syntax_zero_objects skipped, known issue
SKIPPED [1] test/test_swap_n3.py:74: syntax_trailing_semicolon skipped, known issue
SKIPPED [1] test/test_swap_n3.py:74: syntax_neg_formula_predicate skipped, known issue
SKIPPED [1] test/test_swap_n3.py:74: syntax_neg_thisadoc skipped, known issue
SKIPPED [1] test/test_swap_n3.py:74: syntax_too_nested skipped, known issue
SKIPPED [1] test/test_swap_n3.py:74: syntax_this_rules skipped, known issue
SKIPPED [1] test/test_swap_n3.py:74: syntax_zero_predicates skipped, known issue
SKIPPED [1] test/test_swap_n3.py:74: syntax_neg_single_quote skipped, known issue
SKIPPED [1] test/test_swap_n3.py:74: syntax_equals2 skipped, known issue
SKIPPED [1] test/test_swap_n3.py:74: syntax_neg_literal_predicate skipped, known issue
SKIPPED [1] test/test_trig.py:119: Iterative serialization currently produces 16 copies of everything
XFAIL test/test_canonicalization.py::TestConsistency::test_consistent_ids
reason:
XFAIL test/test_diff.py::TestDiff::test_subsets
reason:
XFAIL test/test_issue190.py::test1
Known issue with newlines in text
XFAIL test/test_issue190.py::test2
Known issue with newlines in text
XFAIL test/test_literal.py::TestXsdLiterals::test_make_literals_ki
reason:
XFAIL test/test_namespace.py::ClosedNamespaceTest::test_repr_ef
reason:
XFAIL test/test_util.py::TestUtilTermConvert::test_util_from_n3_not_escapes_xf
reason:
XFAIL test/jsonld/test_util.py::URLTests::test_norm_url_xfail
reason:
FAILED test/test_xmlliterals.py::testHTML - AssertionError: xml must have been parsed
============================================= 1 failed, 3916 passed, 115 skipped, 8 xfailed, 1054 warnings in 65.35s (0:01:05) =============================================
@kloczek I will try reproduce tonight.
So presumably you are doing this from within our source tree? More questions may follow, busy debugging now.
Why are you using same path twice in PYTHONPATH?
PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-rdflib-6.1.1-2.fc35.x86_64/usr/lib64/python3.8/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-rdflib-6.1.1-2.fc35.x86_64/usr/lib/python3.8/site-packages
?
If you could share the rpm specfile you are using and/or make a Dockerfile that reproduces this it would be very helpful, I'm not really that familiar with making RPMs. Still trying things but I doubt it is what you are doing.
So presumably you are doing this from within our source tree? More questions may follow, busy debugging now.
Yes. I'm usimg git tagged tar ball as input source.
Something else I don't get, if you are using fedora 35 (if not please correct me), pytest (/usr/bin/pytest) will install for python 3.10 - though for you it seems it is somehow on python 3.8:
[root@36d348a1bd20 /]# rpm -ql python3-pytest
/usr/bin/py.test
/usr/bin/py.test-3
/usr/bin/py.test-3.10
/usr/bin/pytest
/usr/bin/pytest-3
/usr/bin/pytest-3.10
/usr/lib/python3.10/site-packages/_pytest
/usr/lib/python3.10/site-packages/_pytest/__init__.py
/usr/lib/python3.10/site-packages/_pytest/__pycache__
/usr/lib/python3.10/site-packages/_pytest/__pycache__/__init__.cpython-310.opt-1.pyc
/usr/lib/python3.10/site-packages/_pytest/__pycache__/__init__.cpython-310.opt-2.pyc
...
Why are you using same path twice in PYTHONPATH?
PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-rdflib-6.1.1-2.fc35.x86_64/usr/lib64/python3.8/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-rdflib-6.1.1-2.fc35.x86_64/usr/lib/python3.8/site-packages
?
If you could share the rpm specfile you are using and/or make a Dockerfile that reproduces this it would be very helpful, I'm not really that familiar with making RPMs. Still trying things but I doubt it is what you are doing.
Here is the spec
# BUG: sphinx errors https://github.com/urllib3/urllib3/issues/2507
Summary: Python HTTP library with thread-safe connection pooling and file post
Name: python-urllib3
Version: 1.26.7
Release: 2%{?dist}
License: MIT (https://opensource.org/licenses/MIT/)
URL: https://pypi.org/project/urllib3/
VCS: https://github.com/urllib3/urllib3/
Source0: %{VCS}/archive/%{version}/%{name}-%{version}.tar.gz
Source1: %{name}-ssl_match_hostname_py3.py
Patch00: %{name}-man3_level.patch
Patch01: %{name}-Use-the-standard-library-instead-of-a-backport.patch
Patch02: %{name}-remove_sphinx_furo_dependency.patch
BuildArch: noarch
BuildRequires: python3dist(alabaster)
BuildRequires: python3dist(build)
BuildRequires: python3dist(pip)
BuildRequires: python3dist(requests)
BuildRequires: python3dist(setuptools)
BuildRequires: python3dist(sphinx)
BuildRequires: python3dist(sphinx-copybutton)
BuildRequires: python3dist(wheel)
# CheckRequires:
BuildRequires: python3dist(dateutils)
BuildRequires: python3dist(freezegun)
BuildRequires: python3dist(idna)
BuildRequires: python3dist(pyopenssl)
BuildRequires: python3dist(pysocks)
BuildRequires: python3dist(pytest)
BuildRequires: python3dist(pytest-freezegun)
BuildRequires: python3dist(pytest-timeout)
BuildRequires: python3dist(six)
BuildRequires: python3dist(tornado)
BuildRequires: python3dist(trustme)
Obsoletes: python3-urllib3
%description
Python HTTP module with connection pooling and file POST abilities.
%prep
%autosetup -p1 -n urllib3-%{version}
%build
%pyproject_wheel
%py3_build_sphinx_man
%install
%pyproject_install
%__install -Dm644 build/sphinx/man/*.3 -t %{buildroot}%{_mandir}/man3
%__install -m644 %{S:1} %{buildroot}/%{python3_sitelib}/urllib3/packages/ssl_match_hostname.py
%check
%pytest
%files
%{_mandir}/man3/*
%{python3_sitelib}/urllib3
%{python3_sitelib}/urllib3-*.*-info
%exclude %{python3_sitelib}/urllib3/packages/ssl_match_hostname
On top of tagged tar ball I'm using three patches but I think that none of them should affect pytest.
result.
As I'm rendering only man page I do't need furo
(python-urllib3-remove_sphinx_furo_dependency.patch). I'm changeing generated man page name to python-urllib3.3 (python-urllib3-man3_level.patch).
3rd patch is to use standard unittest
instead mock
(to minimise build dependencies).
That patch does not touches test/test_xmlliterals.py
--- a/docs/conf.py 2021-01-19 06:19:29.624457465 +0000
+++ b/docs/conf.py 2021-01-19 06:18:58.015464152 +0000
@@ -14,7 +14,7 @@
# Mock some expensive/platform-specific modules so build will work.
# (https://read-the-docs.readthedocs.io/en/latest/faq.html#\
# i-get-import-errors-on-libraries-that-depend-on-c-modules)
-import mock
+from unittest import mock
class MockModule(mock.Mock):
--- a/test/test_connectionpool.py 2020-11-12 22:12:12.000000000 +0000
+++ b/test/test_connectionpool.py 2021-01-19 06:18:58.007464154 +0000
@@ -6,7 +6,7 @@
from test import SHORT_TIMEOUT
import pytest
-from mock import Mock
+from unittest.mock import Mock
from dummyserver.server import DEFAULT_CA
from urllib3._collections import HTTPHeaderDict
--- a/test/test_connection.py 2020-11-12 22:12:12.000000000 +0000
+++ b/test/test_connection.py 2021-01-19 06:18:58.006464154 +0000
@@ -1,6 +1,6 @@
import datetime
-import mock
+from unittest import mock
import pytest
from urllib3.connection import RECENT_DATE, CertificateError, _match_hostname
--- a/test/test_queue_monkeypatch.py 2020-11-12 22:12:12.000000000 +0000
+++ b/test/test_queue_monkeypatch.py 2021-01-19 06:18:58.010464153 +0000
@@ -1,6 +1,6 @@
from __future__ import absolute_import
-import mock
+from unittest import mock
import pytest
from urllib3 import HTTPConnectionPool
--- a/test/test_response.py 2020-11-12 22:12:12.000000000 +0000
+++ b/test/test_response.py 2021-01-19 06:18:58.011464153 +0000
@@ -9,7 +9,7 @@
from io import BufferedReader, BytesIO, TextIOWrapper
from test import onlyBrotlipy
-import mock
+from unittest import mock
import pytest
import six
--- a/test/test_retry_deprecated.py 2020-11-12 22:12:12.000000000 +0000
+++ b/test/test_retry_deprecated.py 2021-01-19 06:18:58.012464153 +0000
@@ -1,7 +1,7 @@
# This is a copy-paste of test_retry.py with extra asserts about deprecated options. It will be removed for v2.
import warnings
-import mock
+from unittest import mock
import pytest
from urllib3.exceptions import (
--- a/test/test_retry.py 2020-11-12 22:12:12.000000000 +0000
+++ b/test/test_retry.py 2021-01-19 06:18:58.011464153 +0000
@@ -1,6 +1,6 @@
import warnings
-import mock
+from unittest import mock
import pytest
from urllib3.exceptions import (
--- a/test/test_ssl.py 2020-11-12 22:12:12.000000000 +0000
+++ b/test/test_ssl.py 2021-01-19 06:18:58.012464153 +0000
@@ -1,6 +1,6 @@
from test import notPyPy2
-import mock
+from unittest import mock
import pytest
from urllib3.exceptions import SNIMissingWarning
--- a/test/test_ssltransport.py 2020-11-12 22:12:12.000000000 +0000
+++ b/test/test_ssltransport.py 2021-01-19 06:18:58.013464153 +0000
@@ -4,7 +4,7 @@
import ssl
import sys
-import mock
+from unittest import mock
import pytest
from dummyserver.server import DEFAULT_CA, DEFAULT_CERTS
--- a/test/test_util.py 2020-11-12 22:12:12.000000000 +0000
+++ b/test/test_util.py 2021-01-19 06:18:58.014464152 +0000
@@ -9,7 +9,7 @@
from test import notBrotlipy, onlyBrotlipy, onlyPy2, onlyPy3
import pytest
-from mock import Mock, patch
+from unittest.mock import Mock, patch
from urllib3 import add_stderr_logger, disable_warnings, util
from urllib3.exceptions import (
Okay I managed to reproduce it with: https://gitlab.com/aucampia/scratchpad/-/blob/a3bdd483054b0e436fae90f42e01139c9a5e45a5/dci/rdflib-1519/Dockerfile
$ curl --silent https://gitlab.com/aucampia/scratchpad/-/raw/a3bdd483054b0e436fae90f42e01139c9a5e45a5/dci/rdflib-1519/Dockerfile | docker build -
...
FAILED test/test_xmlliterals.py::testHTML - AssertionError: xml must have bee...
==== 1 failed, 3916 passed, 115 skipped, 8 xfailed, 1054 warnings in 46.85s ====
The command '/bin/sh -c export PYTHONPATH=${HOME}/fakeroot/usr/lib/python3.8/site-packages:${HOME}/fakeroot/usr/lib/python3.8/site-packages && cd /home/devuser/rdflib && python3.8 -m pytest -ra && true' returned a non-zero code: 1
Looking into the cause now.
Something else I don't get, if you are using fedora 35 (if not please correct me), pytest (/usr/bin/pytest) will install for python 3.10 - though for you it seems it is somehow on python 3.8:
I'm not using fedora. I'm using my own distrinution. I still have few python modules to finish and than probably will move to latest python (without cleaned all python modules it soes not make to much sense to move now).
Why are you using same path twice in PYTHONPATH?
PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-rdflib-6.1.1-2.fc35.x86_64/usr/lib64/python3.8/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-rdflib-6.1.1-2.fc35.x86_64/usr/lib/python3.8/site-packages
?
I found taht two days ago. I had bug (typo) in my macros. Current %pytest macro has fixed that and that fix does not affects in this casepytest behaviour.
[tkloczko@ss-desktop SPECS]$ rpm -E %pytest
\
CFLAGS="-O2 -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fdata-sections -ffunction-sections -flto=auto -flto-partition=none";
CXXFLAGS="-O2 -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fdata-sections -ffunction-sections -flto=auto -flto-partition=none";
FFLAGS="-O2 -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fdata-sections -ffunction-sections -flto=auto -flto-partition=none -I/usr/lib64/gfortran/modules";
FCFLAGS="-O2 -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fdata-sections -ffunction-sections -flto=auto -flto-partition=none -I/usr/lib64/gfortran/modules";
LDFLAGS="-Wl,-z,relro -Wl,--as-needed -Wl,--gc-sections -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -flto=auto -flto-partition=none -fuse-linker-plugin -Wl,--build-id=sha1";
CC="/usr/bin/gcc"; CXX="/usr/bin/g++"; FC="/usr/bin/gfortran";
AR="/usr/bin/gcc-ar"; NM="/usr/bin/gcc-nm"; RANLIB="/usr/bin/gcc-ranlib";
export CFLAGS CXXFLAGS FFLAGS FCFLAGS LDFLAGS CC CXX FC AR NM RANLIB;
\
PATH="/home/tkloczko/rpmbuild/BUILDROOT/%{NAME}-%{VERSION}-%{RELEASE}.x86_64/usr/bin:$PATH" \
PYTHONDONTWRITEBYTECODE=1 \
SETUPTOOLS_SCM_PRETEND_VERSION=%{version} \
PYTHONPATH="${PYTHONPATH:-/home/tkloczko/rpmbuild/BUILDROOT/%{NAME}-%{VERSION}-%{RELEASE}.x86_64/usr/lib64/python3.8/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/%{NAME}-%{VERSION}-%{RELEASE}.x86_64/usr/lib/python3.8/site-packages}" \
\
/usr/bin/pytest -ra
Okay the issue is, the tests need html5lib to pass. (ref)
If you want to run tests against installed rdflib, you should install it with tests
extras.
If I run this from within the source repo it works fine:
git checkout 6.1.1
rm -rf /var/tmp/rdflib.fakeroot/
python3.8 -m pip install --root /var/tmp/rdflib.fakeroot/ "rdflib[tests]==6.1.1"
PYTHONPATH=$(readlink -f /var/tmp/rdflib.fakeroot/usr/local/lib{,64}/python3.8/site-packages/ | tr '\n' ':') \
python3.8 -m pytest test/test_xmlliterals.py::testHTML
NOTE: PYTHONPATH
has both /lib/ and /lib64/ in.
Please try install with [tests]
extras and let me know if it works so we can close the issue.
@kloczek I will close this issue next week if there is nothing further.
Closed as there is no further input needed.
python3.8 -m pytest
Please don't call that way pytest. Python executed as python -m foo
always adds to sys.path
curretn directory. Thos is causing many issues. This is why pytest provides pytest script which should be used on testing using that test suite framework.
python3.8 -m pytest
Please don't call that way pytest. Python executed as
python -m foo
always adds tosys.path
curretn directory. Thos is causing many issues. This is why pytest provides pytest script which should be used on testing using that test suite framework.
I changed the way pytest is invoked here: https://github.com/RDFLib/rdflib/pull/2032
If you can submit a Dockerfile which when built reproduces your issue it will make it a lot easier to address, example:
# syntax=docker/dockerfile:1
FROM docker.io/library/python:3.10 AS setup
RUN pip install flask
RUN pip install rdflib
RUN rdfpipe --version
WORKDIR /var/tmp/work
FROM setup AS run
RUN <<EOF
wget https://raw.githubusercontent.com/khancynthia28/flask-sparql/c306b1ee6c56622fd5784a8e6c2819fb661be3c6/nobeldata.owl
EOF
RUN python3 <<EOF
from flask import Flask, render_template, request
import rdflib
g = rdflib.Graph()
g.parse("nobeldata.owl")
print("graph has %s statements." % len(g))
EOF
docker buildx build . --progress plain --no-cache-filter run
#1 [internal] load build definition from Dockerfile
#1 DONE 0.0s
#1 [internal] load build definition from Dockerfile
#1 transferring dockerfile: 91B done
#1 DONE 0.1s
#2 [internal] load .dockerignore
#2 transferring context: 2B done
#2 DONE 0.1s
#3 resolve image config for docker.io/docker/dockerfile:1
#3 DONE 0.2s
#4 docker-image://docker.io/docker/dockerfile:1@sha256:443aab4ca21183e069e7d8b2dc68006594f40bddf1b15bbd83f5137bd93e80e2
#4 CACHED
#5 [internal] load .dockerignore
#5 DONE 0.0s
#6 [internal] load build definition from Dockerfile
#6 DONE 0.0s
#7 [internal] load metadata for docker.io/library/python:3.10
#7 DONE 0.0s
#8 [setup 1/5] FROM docker.io/library/python:3.10
#8 DONE 0.0s
#9 [setup 3/5] RUN pip install rdflib
#9 CACHED
#10 [setup 4/5] RUN rdfpipe --version
#10 CACHED
#11 [setup 2/5] RUN pip install flask
#11 CACHED
#12 [setup 5/5] WORKDIR /var/tmp/work
#12 CACHED
#13 [run 1/2] RUN <<EOF (wget https://raw.githubusercontent.com/khancynthia28/flask-sparql/c306b1ee6c56622fd5784a8e6c2819fb661be3c6/nobeldata.owl)
#13 0.225 --2022-07-18 13:11:10-- https://raw.githubusercontent.com/khancynthia28/flask-sparql/c306b1ee6c56622fd5784a8e6c2819fb661be3c6/nobeldata.owl
#13 0.232 Resolving raw.githubusercontent.com (raw.githubusercontent.com)... 185.199.108.133, 185.199.109.133, 185.199.110.133, ...
#13 0.249 Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|185.199.108.133|:443... connected.
#13 0.271 HTTP request sent, awaiting response... 200 OK
#13 0.276 Length: 733570 (716K) [text/plain]
#13 0.276 Saving to: ‘nobeldata.owl’
#13 0.276
#13 0.276 0K .......... .......... .......... .......... .......... 6% 8.93M 0s
#13 0.282 50K .......... .......... .......... .......... .......... 13% 13.1M 0s
#13 0.285 100K .......... .......... .......... .......... .......... 20% 16.8M 0s
#13 0.288 150K .......... .......... .......... .......... .......... 27% 21.9M 0s
#13 0.290 200K .......... .......... .......... .......... .......... 34% 58.0M 0s
#13 0.291 250K .......... .......... .......... .......... .......... 41% 42.3M 0s
#13 0.292 300K .......... .......... .......... .......... .......... 48% 16.7M 0s
#13 0.295 350K .......... .......... .......... .......... .......... 55% 18.3M 0s
#13 0.298 400K .......... .......... .......... .......... .......... 62% 16.2M 0s
#13 0.301 450K .......... .......... .......... .......... .......... 69% 15.0M 0s
#13 0.304 500K .......... .......... .......... .......... .......... 76% 41.3M 0s
#13 0.305 550K .......... .......... .......... .......... .......... 83% 73.6M 0s
#13 0.306 600K .......... .......... .......... .......... .......... 90% 34.4M 0s
#13 0.308 650K .......... .......... .......... .......... .......... 97% 40.1M 0s
#13 0.309 700K .......... ...... 100% 19.3M=0.03s
#13 0.310
#13 0.310 2022-07-18 13:11:10 (20.9 MB/s) - ‘nobeldata.owl’ saved [733570/733570]
#13 0.310
#13 DONE 0.3s
#14 [run 2/2] RUN python3 <<EOF
#14 1.011 graph has 7780 statements.
#14 DONE 1.1s
#15 exporting to image
#15 exporting layers
#15 exporting layers 1.0s done
#15 writing image sha256:dcf19065fc034446cf460e1b11fe25757485d88260bc3d55c4fc01ddfc52c8bb done
#15 DONE 1.1s
Just tested last release + 4 commitch from master and pytest is now failing in new units Here is pytest output:
BTw: pip should be executed as well not as python -m pip
I'm trying to package 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
Here is pytest output: