It would be useful to find or create a configuration system for use in
repoze.bfg (and other frameworks) that had the same purpose as
zope.configuration (aka ZCML), but rids itself of the hard
dependency on zope.component.
Most frameworks need some form of explicit configuration step. This usually happens in two phases. The first phase is to load the configuration data from some file(s). The second phase is an "execution" phase which operates against the configuration data. The execution phase is not passive, it's active. The return value of the execution phase is not terribly important, it is only executed in order to perform arbitrary setup.
It is often useful to "box this step in" to some known time period. Instead of relying on import ordering to do ad-hoc configuration, making the execution step explicit ensures that the configuration happens in a known order as a result of a single function call. It also forms a convention which can help load "the right" configuration for functional testing and other purposes.
The specific code that is executed depends on what the user puts in the configuration data. The configuration data is typically explicitly not Python: Python is often too powerful for this task. Instead, there is some controlled set of directives in a structured format that are available for users to inject into a configuration file.
Most frameworks also need somewhere to stash and retrieve application-specific settings (as opposed to module-scope settings), as more than one instance of an application using the framework may exist in the same process space.
zope.configuration provides such a system but it assumes that the
framework developer is willing to "bite off" the entire Zope component
architecture. Also, zope.configuration makes the assumption that there
is a single global configuration; this is a limitation that makes it
hard to run multiple instances of an application using the
configuration system in the same process.
zope.component registry within the
system, but the configuration system should not assume it is
populating a component architecture registry.Anyway, that's enough for now. Just thinking out loud.
which is covering some aspects of your usecases. The implementation could be easily changed for providing local configuration utilities specific to individual apps.