-
Notifications
You must be signed in to change notification settings - Fork 113
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for rdflib 5.0.0 #161
Add support for rdflib 5.0.0 #161
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:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
@@ -27,15 +27,15 @@ | |||
], | |||
"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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
rdflib
5.0.0 to theextruct
library.Users of
extruct
currently often encounter issue #131 (module not found) when they upgrade tordflib
5.0.0; this is due to the removal of thepyRdfa
parser plugin as noted here.Fortunately, the standalone
pyRdfa3
library added support to register as anrdflib
plugin in RDFLib/pyrdfa3#26.What this means is that when
pyRdfa3
is installed in the Python environment, it should restore RDFA parsing functionality for users ofrdflib
5.0.0 or greater, and resolve theModuleNotFoundError
.The currently-published PyPi package
pyRdfa3
, version 3.5.3, includes this functionality viardf.plugins.parser
inentry_points.txt
NB: This release isn't currently tagged in the source repo, but I think
pyRdfa3
v3.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
pyRdfa3
from version 4.0.0 (in RDFLib/pyrdfa3#34) -- but from inspection of the Python-code-related changes,extruct
does not appear to depend at all on the affected Python methods (notablycopyErrors
andrdf_from_sources
which are both provided for CGI-related context in the top-levelprocessURI
method).May fix #131 (alternative approach).