Clean up the optional dependencies
We have a number of dependencies which setuptools calls "extras": packages that only needed for unlocking additional functionality but not used otherwise. Ideally, we should not require the user to install them.
It appears that we need to add something like the following to the setup.py:
extras_require = {
"custom_regularizers'': ["numba"],
"large_datasets'': ["dask[dataset]"],
}
and then check if the optional package is installed (I'm not clear how it works exactly)
Then user could install our library with the following syntax: pip install topicnet[custom_regularizers] (which will pull numba).
PS: Naming suggestions are welcome.
I need 2 questions answered: What are the benefits of that action? Will it create problems with installation (like tests failing for some versions)?
-
In our case, the practical benefits are insignificant (getting rid of installing superfluous libraries, but they are not heavy), but this seems to be a good practice.
-
I don't think so. It should be sufficient to skip some tests after checking their dependencies.