IBM / dse-decision-optimization-utilities

A Python package with various utilities that speed-up development of Decision Optimization projects in Watson Studio. Implements common tasks and provides best-practice guidelines to architect DO projects.
Apache License 2.0
4 stars 7 forks source link

Package dependencies and optional dependencies #24

Open victorterpstra opened 2 years ago

victorterpstra commented 2 years ago

Currently, the dse-do-utils doesn't define dependencies. It is up to the user to ensure the packages it requires are installed.

In some cases, the import statement is deep in the code and will only run if the code that depends on it is executed. For instance, folium or sqlalchemy. This avoids the install of these packages if the related functionality of the dse-do-utils is never used.

This approach works, but there might be a better option with optional dependencies:

victorterpstra commented 1 year ago

This is done in setup.py with the extras_require. See

One of the extra could be 'CP4D', with requirements: