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
Use pprint.pformat on versions log message #4203
base: master
Are you sure you want to change the base?
Conversation
This commit use pprint.pformat on overridden settings to keep consistent with scrapy.middleware
Codecov Report
@@ Coverage Diff @@
## master #4203 +/- ##
==========================================
+ Coverage 83.73% 83.73% +<.01%
==========================================
Files 165 165
Lines 9714 9715 +1
Branches 1446 1446
==========================================
+ Hits 8134 8135 +1
Misses 1332 1332
Partials 248 248
|
As seen in the provided example, this changes the order of components.
|
The order is changed by the pprint module, and disabling the sorted function inside pprint is only available in Python 3.8. Although a decorator can be added to fix this, this makes things too complicated. I want to keep the solution simple. And with the help of OrderedDict, the output is like this:
Emmm, which looks strange. I don't like this format break solution. |
We could write a private function just to print the desired output format from the versions iterable. It think it’s either that or wait until we drop support for CPython 3.5. |
Consider nobody raises an issue about this output format and it is quite minor problem, I think we should not do too much work just for this. We can just leave it until the minimum support version becomes Python 3.8. |
3.7 is almost EOL so we can now use |
This commit use pprint.pformat on overridden settings to keep consistent
with scrapy.middleware, for example:
Original:
Now: