Defer imports from font_manager in font module#368
Conversation
Deferring this imports means that a number of places where we need to import from font don't trigger the import time side-effect in the font_manager module modified: kiva/fonttools/font.py
Codecov Report
@@ Coverage Diff @@
## master #368 +/- ##
==========================================
+ Coverage 32.91% 32.91% +<.01%
==========================================
Files 206 206
Lines 18303 18304 +1
Branches 2415 2415
==========================================
+ Hits 6024 6025 +1
Misses 11893 11893
Partials 386 386
Continue to review full report at Codecov.
|
|
What is this fixing, if I may ask? |
|
this PR should fix this issue - enthought/chaco#448 |
Yes. The actual issues i.e. import-time side effects of This PR simply aims to defer the import-time side effects to when the objects are actually needed. Deferring the imports prevents the tracebacks/logs from appearing when For example, at the moment, simply doing There are also a few places where Does that answer your question? |
jwiggins
left a comment
There was a problem hiding this comment.
Yes, I think that's enough context.
|
Thanks for the quick reviews John! |
Defer imports from font_manager in font module
Deferring these imports means that a number of places where we need to import from
fontdon't trigger the import time side-effect in thefont_managermodule.This PR doesn't attempt to actually fix either of the issues #362 or #363 .