The current venvstacks model has exactly three layers:
the application layer (defines the launch module/package that actually does something when deployed)
one or more framework layers defining shared packages that use a given runtime layer
the runtime layer (the actual Python runtime, and potentially some additional commonly needed packages for that runtime)
It would be feasible to make the "depending on framework layers" feature a shared characteristic of both the framework and application layers, rather than restricting it to the application layer.
We would need to define a linearisation algorithm for translating the graph of framework nodes in the declared layer dependencies into a predictable sys.path order in the application layers.
My initial instinct is that it should be sufficient to make that a breadth-first traversal for frameworks (i.e. all first-order framework deps in declared left-to-right order, than second order deps, etc), with the runtime folders always forced to the end regardless of how shallow or deep the framework chains are. However, rather than trying to assure ourselves that the simplistic approach is sufficient, it may be better to instead use a well-defined and studied linearisation algorithm like the C3 algorithm that Python uses to resolve class method resolution orders: https://en.wikipedia.org/wiki/C3_linearization
The current
venvstacks
model has exactly three layers:It would be feasible to make the "depending on framework layers" feature a shared characteristic of both the framework and application layers, rather than restricting it to the application layer.
We would need to define a linearisation algorithm for translating the graph of framework nodes in the declared layer dependencies into a predictable
sys.path
order in the application layers.My initial instinct is that it should be sufficient to make that a breadth-first traversal for frameworks (i.e. all first-order framework deps in declared left-to-right order, than second order deps, etc), with the runtime folders always forced to the end regardless of how shallow or deep the framework chains are. However, rather than trying to assure ourselves that the simplistic approach is sufficient, it may be better to instead use a well-defined and studied linearisation algorithm like the C3 algorithm that Python uses to resolve class method resolution orders: https://en.wikipedia.org/wiki/C3_linearization