add kiwisolver not install warning for import error#1019
Conversation
|
As discussed during the standup, let's move from using |
|
Just to make sure I understand: the problem being solved here is that while If so, I don't think we want any sort of warning for general Enable use (e.g., when importing |
Thanks for the comments. There are about 10 tests that are using this package, it seems inefficient if we try to add individual warnings to each of them. Is there a way we can add warning for all the imports (like wrapping imports with a decorator)? |
For tests that require kiwisolver you want to skip the tests unless it is installed, not warn. But also it should possibly be in the "test" optional dependencies. Edit to add: which it looks is exactly what the tests are doing. |
I think the tests are fine as they are - we're already skipping the tests for For the examples, I see two examples that use the One other possibility, available since Python 3.7 (see PEP 562), would be to add a module-level |
|
Thanks @mdickinson and @corranwebster. Agreed on not needing any noise with the warnings for general enable use. @homosapien-lcy as @mdickinson suggests, let's just get the two examples updated with a better error message. |
OK, got it fixed |
Now, kiwisolver is listed as optional but in some demo as mentioned in issue #1018, it can raise import error. This PR gives a specific error when it's not installed and the related tests are run. Closes #1018