alan-turing-institute / DTBase

A starting point from which digital twins can be developed.
MIT License
11 stars 4 forks source link

Subpackages/dependency management #246

Open mhauru opened 8 months ago

mhauru commented 8 months ago

dtbase, as a Python package, is monolithic. When you install it, you get everything: Backend, frontend, models, all that. This keeps it simple, but causes lots of unnecessary code, and unnecessary dependencies to be installed in many situations, such as when building Docker containers or using BaseService on a remote machine that talks to DTBase.

Options: 1) Keep everything as is. No choice here is perfect, so this might still be the best balance. 2) Have granular specification of dependencies. Maybe pip install .[frontend] to e.g. install stuff that only the frontend needs. Can we make pip install . behave like pip install .[all], so that by default everything works? 3) Break the repo into subpackages. Either 3a) one package for each part, such as frontend, backend, etc. 3b) just a couple of packages, such as models, ingress, and everything else. 4) Break the repo into many repos. Maybe have a master repo that includes the others as git submodules. Just kidding, I'm not insane.

mhauru commented 7 months ago

Can we make pip install . behave like pip install .[all], so that by default everything works?

I looked into this, and the answer is no, this is not possible. If we want to use optional dependencies like pip install .[frontend], then the default dependencies installed by just pip install . have to be minimal.