thegraphnetwork / epigraphhub_py

Epigraphhub Python package
GNU General Public License v3.0
2 stars 9 forks source link

Add "extra" dependencies to package #202

Closed fccoelho closed 1 year ago

fccoelho commented 1 year ago

We need to make some dependency optional, to minimize the dependencies on a simple install of the package.

I suggest the first extras should be called "ML"

[tool.poetry.extras]
ML = ["ngboost", "pymc","tensorflow", "scikit-learn", "arviz", "joblib"]

and of courses these packages should be removed from [tool.poetry.dependencies] With this, the user can install the extra "ML" packages with the following command:

pip install epigraphhub[ML]

Other groups can be added later.

A consequence of this is that the imports of these packages in the library must be wrapped in try/except clauses, and when functions requiring these packages are called, they must check if the package is installed, and if not, return a message to the user, saying that she needs to install the extra dependencies.

luabida commented 1 year ago

Reminder: Talking about tests scope, one possibility is to add these deps in the __init__.py inside a try except block with a warning

Kd-Here commented 1 year ago

Can I give here a try?

luabida commented 1 year ago

@Kd-Here Sure :)

github-actions[bot] commented 1 year ago

Stale issue message