_loader: Adding LoadContext
Instead of passing around many details though calling signatures throughout the loader code, create a single LoadContext object which holds any overall loading state along with any values which are constant to a full load process.
Overall this patch does:
-
_frontend/app.py: No need to pass Stream.fetch_subprojects() along anymore
-
_loader/loadelement.pyx: collect_element_no_deps() no longer takes a task argument
-
_loader/loader.py: Now the Loader has a
load_context
member, and no more_fetch_subprojects
member or_context
membersFurther,
rewritable
andticker
is no longer passed along through all of the recursing calling signatures, andticker
itself is finally removed because this has been replaced a long time ago withTask
API fromState
. -
_pipeline.py: The load() function no longer has a
rewritable
parameter -
_project.py: The Project() is responsible for creating the toplevel LoadContext() if one doesn't exist yet, and this is passed through to the Loader() (and also passed to the Project() constructor by the Loader() when instantiating subprojects).
-
_stream.py: The
Stream._fetch_subprojects()
is now private and set on the project when giving the Project to the Stream inStream.set_project()
, also the Stream() sets therewritable
state on theLoadContext
at the earliest opportunity, as theStream()
is the one who decides this detail.Further, some double underscore private functions are now regular single underscores, there was no reason for this inconsistency.