Allow framework layers to form a directed acyclic graph #18
Labels
Affects: Command Line
Affects the command line interface
Affects: Python API
Affects the public Python API of the project
Affects: Spec Format
Affect the stack specification format
Category: Enhancement
New feature or request
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
The text was updated successfully, but these errors were encountered: