-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Jinja upgrade to v3 #1490
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
Closed
jrherskovic-mda
wants to merge
25
commits into
python-openxml:dependabot/pip/jinja2-3.1.3
from
jrherskovic-mda:master
Closed
Jinja upgrade to v3 #1490
jrherskovic-mda
wants to merge
25
commits into
python-openxml:dependabot/pip/jinja2-3.1.3
from
jrherskovic-mda:master
Conversation
This file contains hidden or 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
No need for two, use the already modernized `docx.shared.lazyproperty`.
Use XPath rather than oxml structures.
This property was formerly known as `._grid_col` but that didn't account for `.grid_before` in the computation.
This method was formerly named `.tc_at_grid_col()`. New implementation takes `CT_Tr.grid_before` into account.
The original implementation of `_Row.cells` did not take into account the fact that rows could include unoccupied grid cells at the beginning and/or end of the row. This "advanced" feature of tables is sometimes used by the Word table layout algorithm when the user does not carefully align the right boundary of cells during resizing, so while quite unusual to be used on purpose, this arises with some frequency in human-authored documents in the wild. The prior implementation of `_Row.cells` assumed that `Table.cells()` was uniform and the cells for a row could be reliably be computed from the table column-count and row and column offsets. That assumption does not always hold and can raise `IndexError` when omitted cells are present. This reimplementation remedies that situation. As a side-effect it should also perform much better when reading large tables.
`lxml` won't install on Apple Silicon after `4.9.2`. Dropping testing for Python 3.7.
`.rel_ref_count()` as implemented was only applicable to `XmlPart` where references to a related part could be present in the XML. Longer term it probably makes sense to override `Part.drop_rel()` in `XmlPart` and not have a `_rel_ref_count()` method in `part` at all, but this works and is less potentially disruptive.
Looks like this cure is worse than the disease. While it may ease installation on Apple Silicon in some instances, it breaks installation on Python 3.12. Pull this pin and we'll just have to live with troublesome `lxml` install on certain Mac/version combinations.
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.
No description provided.