forked from python-openxml/python-docx
-
Notifications
You must be signed in to change notification settings - Fork 3
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
v1.0.0 - change package name, merge upstream, add Custom Properties support #23
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
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).
comment part on Document part would return two different parts when loaded with comments_parth vs. _comments_part because of loading from self.package? I think maybe it was loading a default
…art because it has w:p
# Conflicts: # HISTORY.rst # src/docx/__init__.py # src/docx/oxml/__init__.py # src/docx/oxml/table.py # src/docx/oxml/text/paragraph.py # src/docx/oxml/text/parfmt.py # src/docx/text/paragraph.py
…es' into DEV-3861 # Conflicts: # src/docx/opc/package.py
Dev 3948: Merge in python-openxml/python-docx up to v1.1.2
DEV-3861: Add Custom properties functionality
jonathanherr
approved these changes
May 23, 2024
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.
CHANGELOG
python-docx-bb
to avoid confusion with version numbers of upstream packagepython-openxml/python-docx:1.1.2
michael-koeller:feature/custom_properties
- Fix python-openxml#1385 Support use of Part._rels by python-docx-template
- Add support and testing for Python 3.12
- Fix python-openxml#1335 Tolerate invalid float value in bottom-margin
- Fix python-openxml#1337 Do not require typing-extensions at runtime
- Add Hyperlink.fragment and .url
- Fix python-openxml#85: Paragraph.text includes hyperlink text
- Add python-openxml#1113: Hyperlink.address
- Add Hyperlink.contains_page_break
- Add Hyperlink.runs
- Add Hyperlink.text
- Add Paragraph.contains_page_break
- Add Paragraph.hyperlinks
- Add Paragraph.iter_inner_content()
- Add Paragraph.rendered_page_breaks
- Add RenderedPageBreak.following_paragraph_fragment
- Add RenderedPageBreak.preceding_paragraph_fragment
- Add Run.contains_page_break
- Add Run.iter_inner_content()
- Add Section.iter_inner_content()
Component PRs