Motivations:
- Sometimes modules are getting imported several times through lazy import
- Not easy to manage dependencies from file to file
This is how we are managing dependencies now
# current state of lazy import
def lazy_umap_import_has_dependancy():
try:
import warnings
warnings.filterwarnings("ignore")
import umap # noqa
return True, "ok", umap
except ModuleNotFoundError as e:
return False, e, None
After dependency manager it will look like
deps = DepManager()
cuml, has_cuml = deps.cuml
umap, has_umap = deps.umap
Aim
- provides readability, smart dependency management
- easy to write unit tests,
- it will only import the packages once
working example

Motivations:
This is how we are managing dependencies now
After dependency manager it will look like
Aim
working example