-
Notifications
You must be signed in to change notification settings - Fork 55
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
Consider making pygments an optional dependency for pyface.api #655
Comments
Related: #446 |
Confusing terminology here: Pygments is an optional dependency currently: Lines 24 to 27 in 4bccc3e
I think what you are suggesting is shifting the imports out of top-level modules and into the functions/methods where they are used? |
Hmmm, I am thinking of maybe something like this:
|
No, I think the dependencies are best kept as-is. Pygments isn't a huge dependency and a lot of the examples use the code widget, and having it as an "all_features" implies that it is used by wx (which it isn't). I would be OK with shifting imports so that it is imported at use time (if possible - it may not be), so if you don't have it installed you don't get an immediate error. But I'd also be OK with leaving it as-is to avoid the support issues of the form "the code editor is broken". The issue which graphcanvas is experiencing is really due to a limitation in EDM, and this doesn't help with that in any case. |
Just to clarify... I think when I included the code snipte for the Sorry for omitting to mention that too (I thought the original comment implied that already). |
Actually, that might be a better way to implement this... The goal is such that if one has Qt in the environment, importing If someone needs to import PythonEditor and they did not have pygments, then they should install it (it is understandable to require pygments for a feature that provides highlighting capability). In any case, these optional dependencies should be documented, just like wxPython/PySide2/... being optional dependencies. (The "all_features" name can be changed to be more specific, but it is roughly the same idea.) |
pygments
is only required forCodeEditor
andPythonShell
(qt). For use cases where neither of these objects are required, one still needs to havepygments
in the environment in order to import anything frompyface.api
.Consider deferring this dependency until the said widgets are required.
The text was updated successfully, but these errors were encountered: