Pull updates from master repo#4
Open
taras-panasiuk-dev wants to merge 126 commits intoquintagroup:masterfrom
Open
Pull updates from master repo#4taras-panasiuk-dev wants to merge 126 commits intoquintagroup:masterfrom
taras-panasiuk-dev wants to merge 126 commits intoquintagroup:masterfrom
Conversation
This improves packaging reliability because it prevents tests from running against the current directory instead of the installed version of the package.
This required a large number of adjustments. I took the opportunity to make some further clean-up of top-matter.
Also any Python 2 clean-up that was handy.
* encoding header is no longer needed * from __future__ imports no longer needed * make module docstrings PEP 257 compliant.
Sphinx handling is actually better, not only using italic but also a mono-width font.
Done by `docformatter`, it can't get the summary line right if it's too long, but adjusts the description block width and gets the shorter docstrings right, so a lot better than doing them all by hand. The rest will have to wait for hand curation as we go.
Back in the day I thought it better to extract a test-specific fixture for each test. That had the benefit of making parameterized tests fold cleanly without the parameters in the decorator. The downside was you had to look in two places to understand the test so I dropped that practice. Fix some of these I need to change or add to later.
The old @lazyproperty implementation worked, but was much messier than the modern version, adding a member to the object __dict__. This later version that stores the value in the descriptor is much more tidy and more performant too I expect.
Also for example `BaseStoryPart` -> `StoryPart` for the same reason.
This removes some import cycles.
Metaclasses are different and somewhat better in Python 3. Modernize the `xmlchemy` custom element metaclass mechanism and remove Python 2 work-arounds that are no longer required.
Add additional run inner-content elements having a text equivalent, in particular `w:noBreakHyphen` and `w:ptab`. Give each of them their own custom element class having a `__str__()` method so they can each report their text content (constant in some cases like "-" for no-break hyphen).
- inline single-test fixtures - remove obsolete pre-cxml XML builders
Run `ruff format` on code base.
The removed `._insert_pic(pic)` call is redundant because the `pic` element is already inserted by the prior `CT_Inline.new()` call. The reason the second `._insert_pic()` call did not add a second `pic` element is that the `pic` element is the same instance in both cases. So that `pic` element is "moved" from where it was, back to the same place.
Provides access to the comments collection from the document object.
Provide a way to get a `Comments` object from the `DocumentPart`.
Also involves adding `CommentsPart.default`. Because the comments part is optional, we need a mechanism to add a default (empty) comments part when one is not present. This is what `CommentsPart.default()` is for.
CommentsPart is loaded as XML-part on document deserialization.
To get a comment by id, None when not found.
Actual implementation is primarily inherited from `BlockItemContainer`, but support for those operations must be present in `CT_Comment` and it's worth testing explicitly.
Only with `text` parameter so far. Author and initials parameters to follow.
- allow setting on construction - allow update with property setters
- developer/analysis docs - user docs - API docs
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
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.