-
Notifications
You must be signed in to change notification settings - Fork 253
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
Support character based line wrapping (#649) #657
Conversation
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## master #657 +/- ##
==========================================
+ Coverage 93.68% 93.71% +0.02%
==========================================
Files 26 26
Lines 6923 6949 +26
Branches 1235 1240 +5
==========================================
+ Hits 6486 6512 +26
Misses 260 260
Partials 177 177
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
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.
Good job @gmischler!
@@ -42,7 +42,7 @@ def test_load_invalid_base64_data(): | |||
|
|||
|
|||
# ensure memory usage does not get too high - this value depends on Python version: | |||
@memunit.assert_lt_mb(141) | |||
@memunit.assert_lt_mb(200) |
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.
Please do not bump this above 150MB, it's not necessary
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.
What's the point?
The demand will rise with every new test added, and that seems unlikely to get fixed in pytest any time soon.
Is there any real disadvantage of adding some extra headroom here?
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.
I'm still not sure this is due to pytest
... Investigation is ongoing in #641
The point is that keeping those thresholds allows me to keep track of how fast / what causes memory usage increases.
So far they helped me to link the growing number of tests with this memory usage, but this could be spurious-correlation...
As long as the increasing memory usage problem is not solved, I'd prefer to keep those checks a low as possible, in hope this will help pinpoint the origin of the issue
A manual break happens any time the \\n character is met, | ||
Upon method exit, the current position is left near the end of the text, ready for the next call to continue without a gap, potentially with a different font or size set. Returns a boolean indicating if page break was triggered. | ||
space or soft-hyphen character (in word wrap mode) or at the current position (in | ||
character break mode), and text continues from the left margin. |
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.
Similarly to the "Right-to-Left & Arabic Script workaround" section above,
maybe an explicit suggestion could be made of using wrapmode='CHAR'
for langages like chinese or japanese that do not separate words with spaces?
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.
The whole section is about limitations (and their workarounds) right now, which this really isn't.
But we can turn it into a general typography and language specifics section.
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.
But we can turn it into a general typography and language specifics section.
Yes, this would be great!
You will need to rebase and fix some minor merge conflicts in I'm going to wait for this PR and then I'll publish a new release |
Hi @gmischler! Do you think you will have time to add the final touches to this PR in the close future? |
Sorry, I'm out of the country until end of next week. Will get to it after that. |
OK, no worries, it can wait 😊 |
Hi @gmischler! Do you plan to continue this PR in the future? 😊 |
Yes I do. Actually, I was about to get back to it in short order... |
As far as I am concerned, this is ready now. Interesting that we're also running into a timeout here now:
I have made it a habit of excluding test_perfs locally for months now, because it very regularly fails to complete in time... |
Great! 😊
Could you try removing Apart from that and from the memory caps, |
My branch is up to date and only shows my own changes over there. No idea why ist shows so many other changes here.
That seems to have done the trick. |
This may be because there were "Merge commits" performed on your If you don't mind, a simple solution could be to squash all the commits in this PR into a single commit 😊 |
Co-authored-by: Lucas Cimon <925560+Lucas-C@users.noreply.github.com>
d109b52
to
1bb75f5
Compare
Ok, after the recent changes to master, a new rebase seems to have done the trick. @Lucas-C , as far as I can tell it's now ready to merge. |
Merged! Thank you @gmischler 😊 |
e.g. Fixes #649
Checklist:
meaning that both
pylint
(static code analyzer) andblack
(code formatter) are happy with the changes of this PR.docs/
folderCHANGELOG.md
multi_cell()
andwrite()
now have awrapmode
argument, which can be "WORD" or "CHAR".By submitting this pull request, I confirm that my contribution is made under the terms of the GNU LGPL 3.0 license.