-
Notifications
You must be signed in to change notification settings - Fork 44
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
Fix svg backend issue with pyparsing version >= 3 #888
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fixes #887 This PR fixes an issue because of an upstream change with the pyparsing CaselessLiteral class, where the name attribute became a read-only property in version >= 3. We now use the new public set_name method instead of directly setting the attribute.
rahulporuri
commented
Nov 8, 2021
the new set_name API is only available on pyparsing version >= 3 so we use packaging to handle the behavior according to the version this commit makes packaging a dependency of the svg backend and this commit adds a regression test modified: enable/__init__.py modified: enable/savage/svg/pathdata.py modified: enable/savage/svg/tests/test_pathdata.py
rahulporuri
changed the title
[WIP] Fix svg backend issue with pyparsing version >= 3
Fix svg backend issue with pyparsing version >= 3
Nov 8, 2021
Sigh. The linux jobs are waiting because they're looking for non-existent ubuntu-16.04 workers. |
jwiggins
reviewed
Nov 9, 2021
instead of manually parsing and checking the pyparsing version and calling the relevant method depending on the version, we simply check for the existence of the set_name method now and use it if it exists. If it doesnt, we fall back to the old setName method The dependence of packaging has now been removed because we dont need to parse the version anymore modified: enable/__init__.py modified: enable/savage/svg/pathdata.py
jwiggins
approved these changes
Nov 9, 2021
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 update. LGTM.
rahulporuri
pushed a commit
that referenced
this pull request
Nov 9, 2021
* FIX : Fix issue with pyparsing version >= 3 fixes #887 This PR fixes an issue because of an upstream change with the pyparsing CaselessLiteral class, where the name attribute became a read-only property in version >= 3. We now use the new public set_name method instead of directly setting the attribute. * FIX : Handle pyparsing versions 2 and 3 accordingly the new set_name API is only available on pyparsing version >= 3 so we use packaging to handle the behavior according to the version this commit makes packaging a dependency of the svg backend and this commit adds a regression test modified: enable/__init__.py modified: enable/savage/svg/pathdata.py modified: enable/savage/svg/tests/test_pathdata.py * REF : Go with a simpler solution of checking for the method name instead of manually parsing and checking the pyparsing version and calling the relevant method depending on the version, we simply check for the existence of the set_name method now and use it if it exists. If it doesnt, we fall back to the old setName method The dependence of packaging has now been removed because we dont need to parse the version anymore modified: enable/__init__.py modified: enable/savage/svg/pathdata.py
rahulporuri
pushed a commit
that referenced
this pull request
Nov 9, 2021
* Fix svg backend issue with pyparsing version >= 3 (#888) * FIX : Fix issue with pyparsing version >= 3 fixes #887 This PR fixes an issue because of an upstream change with the pyparsing CaselessLiteral class, where the name attribute became a read-only property in version >= 3. We now use the new public set_name method instead of directly setting the attribute. * FIX : Handle pyparsing versions 2 and 3 accordingly the new set_name API is only available on pyparsing version >= 3 so we use packaging to handle the behavior according to the version this commit makes packaging a dependency of the svg backend and this commit adds a regression test modified: enable/__init__.py modified: enable/savage/svg/pathdata.py modified: enable/savage/svg/tests/test_pathdata.py * REF : Go with a simpler solution of checking for the method name instead of manually parsing and checking the pyparsing version and calling the relevant method depending on the version, we simply check for the existence of the set_name method now and use it if it exists. If it doesnt, we fall back to the old setName method The dependence of packaging has now been removed because we dont need to parse the version anymore modified: enable/__init__.py modified: enable/savage/svg/pathdata.py * Test on ubuntu-18.04, not 16.04 (#889) * FIX : Test on ubuntu-18.04, not 16.04 ubuntu-16.04 is no longer available on GitHub Actions CI * FIX : Use ubuntu-latest instead of ubuntu-18.04 * FIX : Use ubuntu-18.04 with the right package repository modified: .github/workflows/test-with-edm.yml modified: ci/edmtool.py * FIX : Install libsdl2-dev using the ubuntu package manager modified: .github/workflows/test-with-edm.yml * FIX : Use libsdl1.2, not libsdl2 modified: .github/workflows/test-with-edm.yml
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
fixes #887
This PR fixes an issue because of an upstream change with the
pyparsing
CaselessLiteral
class, where thename
attribute became a read-only property in version >= 3. We now use the new publicset_name
method instead of directly setting the attribute.Confusingly, this isn't documented in the API changes section of the documentation - https://pyparsing-docs.readthedocs.io/en/latest/whats_new_in_3_0_0.html#api-changes but it can be found by digging into the codebase https://github.com/pyparsing/pyparsing/blob/0352555d968f9952800f0728383de8e1f9526e1e/pyparsing/core.py#L1802-L1805. Note that
CaselessLiteral
inherits fromToken
which in turn inherits fromParserElement
, which contains the propertyname
and the newset_name
public API.Note to reviewer : I tested this branch locally in an environment with the latest pyparsing from PyPI (3.0.5) and the testsuite passed.
Todo