Calysto / metakernel

Jupyter/IPython Kernel Tools

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Shouldn't portalocker and ipyparallel be optional dependencies?

mdeff opened this issue · comments

They are marked as hard dependencies in the install_requires field of setup.py (i.e., they will be automatically installed by pip for everyone). A quick look at the imports however seems to indicate that those are optional features.

Sounds reasonable; do you want to make a PR? Do we then need to change the code to check if they are available?

I can try a PR for this one. ;) You can't assume that they are there and import them when metakernel is imported. The idiomatic thing to do is to lazily import them when needed. If the feature is used while the package is not installed, a ModuleNotFoundError exception will inform the user. Alternatively, you can catch that exception and prompt the user to install the missing package.