Add support for rdflib 5.0.0#161
Add support for rdflib 5.0.0#161lopuhin merged 5 commits intoscrapinghub:masterfrom openculinary:dependencies/rdflib-5.0.0
Conversation
|
⏸️ Sigh, after all that, this upgrade might not be so simple after all. When using |
This corresponds to an upstream pyRdfa change in commit 9c893ecd92c5dfcf7ab8f441eecda787ba13bef6
|
⏯️ Ok, this is in progress again; the module resolution error was due to the fact that I'd failed to update some module imports within the library, and there was also an upstream change regarding the Tests pass under Python2.7 but I'm still seeing a test failure under Python3: |
|
The remaining issue with the Python 3.x's Python 2.7 sorts the attributes and as a result they meet the current XMLNS attributes are added by When Python 2.7 sorts these attribute keys it brings Python 3.x retains the attribute ordering and leaves the default Possible paths forward
|
…ribute ordering differences are not considered to be test failures
|
Ok, the latest commit pushes a change for which I'm able to get tests to pass for both Python 2.7 and Python 3.9. Unfortunately since Travis builds may not be running at the moment, this may not be apparent from the pull request as-is. The approach taken was to add a workaround in the test suite, to ignore differences in attribute ordering. This was achieved by using The rationale behind this is:
|
lopuhin
left a comment
There was a problem hiding this comment.
Thanks for the PR @jayaddison , I agree with your call re python 2.7 tests, and the changes look great! Let me have another look at it, but so far I don't see any issues.
| ], | ||
| "http://purl.org/rss/1.0/modules/content/encoded": [ | ||
| { | ||
| "@value": "<p xml:lang=\"en\" xmlns=\"http://www.w3.org/1999/xhtml\" xmlns:content=\"http://purl.org/rss/1.0/modules/content/\" xmlns:dc=\"http://purl.org/dc/terms/\" xmlns:foaf=\"http://xmlns.com/foaf/0.1/\" xmlns:og=\"http://ogp.me/ns#\" xmlns:rdfs=\"http://www.w3.org/2000/01/rdf-schema#\" xmlns:sioc=\"http://rdfs.org/sioc/ns#\" xmlns:sioct=\"http://rdfs.org/sioc/types#\" xmlns:skos=\"http://www.w3.org/2004/02/skos/core#\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema#\">Op deze vernieuwde website kunt u enkele van mijn projecten vinden, tevens kunt u lessen downloaden die ik heb gemaakt.</p>\n\n", |
There was a problem hiding this comment.
This is the commit RDFLib/pyrdfa3@9c893ec referenced in 98f2205
|
Thanks @lopuhin! |
|
thanks for the PR @jayaddison 👍 The changes look good to me. There are two issues, both unrelated to this PR:
So let us try to fix the builds first. |
lopuhin
left a comment
There was a problem hiding this comment.
tests passed in #165 , merging, thanks again @jayaddison
|
Btw this PR also fixes tests for python 3.8 and 3.9 (which were broken in master). |
|
Hi @lopuhin - not urgent, but I was wondering whether you know when there might be an updated release of |
|
hi @jayaddison good point, let me work on it this week - the only blocker is moving the release to github actions from travis, should not take long. |
|
@lopuhin That'd be great, but take your time; I didn't realize that'd require setup in CI. Thanks for the update. |
|
@jayaddison it's released now, thanks again for your contributions 👍 |
|
Brilliant, thanks again @lopuhin! |
This changeset adds support for
rdflib5.0.0 to theextructlibrary.Users of
extructcurrently often encounter issue #131 (module not found) when they upgrade tordflib5.0.0; this is due to the removal of thepyRdfaparser plugin as noted here.Fortunately, the standalone
pyRdfa3library added support to register as anrdflibplugin in RDFLib/pyrdfa3#26.What this means is that when
pyRdfa3is installed in the Python environment, it should restore RDFA parsing functionality for users ofrdflib5.0.0 or greater, and resolve theModuleNotFoundError.The currently-published PyPi package
pyRdfa3, version 3.5.3, includes this functionality viardf.plugins.parserinentry_points.txtNB: This release isn't currently tagged in the source repo, but I think
pyRdfa3v3.5.3 is from around commit RDFLib/pyrdfa3@1562b3f or RDFLib/pyrdfa3@b623cdd based on looking at some diffs.NB: A note of caution for review/usage is that full Python3 support has been added to
pyRdfa3from version 4.0.0 (in RDFLib/pyrdfa3#34) -- but from inspection of the Python-code-related changes,extructdoes not appear to depend at all on the affected Python methods (notablycopyErrorsandrdf_from_sourceswhich are both provided for CGI-related context in the top-levelprocessURImethod).May fix #131 (alternative approach).