TopicNet icon indicating copy to clipboard operation
TopicNet copied to clipboard

Clean up the optional dependencies

Open bt2901 opened this issue 5 years ago • 2 comments

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.

bt2901 avatar May 24 '20 20:05 bt2901

I need 2 questions answered: What are the benefits of that action? Will it create problems with installation (like tests failing for some versions)?

Evgeny-Egorov-Projects avatar May 25 '20 10:05 Evgeny-Egorov-Projects

  1. 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.

  2. I don't think so. It should be sufficient to skip some tests after checking their dependencies.

bt2901 avatar May 25 '20 11:05 bt2901