-
Notifications
You must be signed in to change notification settings - Fork 79
Upgrade to wcwidth 0.3.1, drop Python 3.7 #344
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
base: master
Are you sure you want to change the base?
Conversation
first draft
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #344 +/- ##
==========================================
- Coverage 98.45% 98.42% -0.03%
==========================================
Files 11 11
Lines 2649 2607 -42
Branches 471 460 -11
==========================================
- Hits 2608 2566 -42
Misses 31 31
Partials 10 10 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
CodSpeed Performance ReportMerging this PR will improve performance by ×410Comparing Summary
Performance Changes
|
|
3.15 was optional because it's still pre-release, scheduled for release in October. That said, it's probably more signal than noise at this point. Are you thinking we'll add optional back if that changes or when we switch to testing 3.16 pre-release? |
|
I just figured since we fixed the textwrap compatibility issue, I have never seen any failing tests since then so it is no harm |
I think you're right, though maybe better to comment out the line so we don't forget we can just mark it optional if it starts failing again and it's not a quick fix. |
|
I reverted it to make 3.15 optional, again. |
CI
Performance
Sequencemethod implementations with wcwidth's new functions:ljust(),rjust(),center(),clip(), andwidth()usingcontrol_codes='ignore', new since 0.3.0.2 Changing Behaviors
length()method now returns maximum cursor extent rather than final relative cursor position:term.length('x\b')was0, now1!term.length(f'{"_" * 10}{term.cub(10)}')was0, now10!This is preferred !
truncate()method now fills with space when a wide character doesn't fit:For leading space this new behavior is absolutely necessary, like if we wanted to do horizontal scrolling of CJK characters, to do this 1 cell at a time will require an oscillating leading
' 'at the beginning of the string.I admit trailing space is a little bit questionable, we want a string "no wider than x", and if it is less that is probably fine and there is no need for trailing space, the caller could use 'ljust()' to padd it if necessary, this is just how it worked out in the wcwidth implementation.