optional_module¶
TODO: Maybe the approach should be:
Use single module proto_kernel (when in runtime_proto) generated out of
multiple modules which primer_kernel imports (when in runtime_meta).
Intro¶
Some functionality from proto_code proto_code may be optional.
Optional functionality is provided via optional modules
which are maintained the same way as the main protoprimer.primer_kernel module:
during
runtime_proto, import goes from a copyduring
runtime_meta, import goes from the deployed package
For example, eval sub command (see effective_config)
is implemented via:
proto_config.pymodule duringruntime_protoprotoprimer.primer_configmodule duringruntime_meta
CLI support¶
The argparse configuration can dynamically attempt to import optional modules and
either expose or not certain options to user.
Minimal layout¶
In the case of min layout (see env_layout),
it should be optional to deploy a copy of optional modules together with the copy of primer_kernel.
Approach to import¶
Such optional modules are imported relative to proto_code dir:
without running
pythonwith a module (still standalone script)without turning
proto_codedir into module directory with__init__.pyfileswithout modifying
sys.path